Index: ddraw/ShaderGen2D.cpp |
— | — | @@ -116,14 +116,14 @@ |
117 | 117 | };
|
118 | 118 |
|
119 | 119 | const DWORD supported_rops[8] = {
|
120 | | - 0x00008001,
|
| 120 | + 0x00028001,
|
121 | 121 | 0x00080000,
|
122 | | - 0x00200000,
|
123 | | - 0x00000000,
|
124 | | - 0x00000000,
|
125 | | - 0x00000400,
|
126 | | - 0x00001000,
|
127 | | - 0x80010000
|
| 122 | + 0x04200010,
|
| 123 | + 0x00000040,
|
| 124 | + 0x00000100,
|
| 125 | + 0x08000400,
|
| 126 | + 0x00001001,
|
| 127 | + 0x88014000
|
128 | 128 | };
|
129 | 129 |
|
130 | 130 | const DWORD supported_rops_gl2[8] = {
|
— | — | @@ -217,6 +217,7 @@ |
218 | 218 | "",
|
219 | 219 | "pixel = pattern ^ ivec4(255);\n",//0F
|
220 | 220 | "",//10
|
| 221 | +"pixel = (dest | pixel) ^ ivec4(255);\n",//11 NOTSRCERASE
|
221 | 222 | "",
|
222 | 223 | "",
|
223 | 224 | "",
|
— | — | @@ -230,7 +231,6 @@ |
231 | 232 | "",
|
232 | 233 | "",
|
233 | 234 | "",
|
234 | | -"",
|
235 | 235 | "",//1F
|
236 | 236 | "",//20
|
237 | 237 | "",
|
— | — | @@ -268,6 +268,7 @@ |
269 | 269 | "",
|
270 | 270 | "",
|
271 | 271 | "",
|
| 272 | +"pixel = pixel & (dest ^ ivec4(255));\n",//44 SRCERASE
|
272 | 273 | "",
|
273 | 274 | "",
|
274 | 275 | "",
|
— | — | @@ -278,7 +279,6 @@ |
279 | 280 | "",
|
280 | 281 | "",
|
281 | 282 | "",
|
282 | | -"",
|
283 | 283 | "",//4F
|
284 | 284 | "",//50
|
285 | 285 | "",
|
— | — | @@ -290,11 +290,11 @@ |
291 | 291 | "",
|
292 | 292 | "",
|
293 | 293 | "",
|
| 294 | +"pixel = dest ^ pattern;\n",//5A PATINVERT
|
294 | 295 | "",
|
295 | 296 | "",
|
296 | 297 | "",
|
297 | 298 | "",
|
298 | | -"",
|
299 | 299 | "",//5F
|
300 | 300 | "",//60
|
301 | 301 | "",
|
— | — | @@ -302,6 +302,7 @@ |
303 | 303 | "",
|
304 | 304 | "",
|
305 | 305 | "",
|
| 306 | +"pixel = pixel ^ dest;\n",//66 SRCINVERT
|
306 | 307 | "",
|
307 | 308 | "",
|
308 | 309 | "",
|
— | — | @@ -310,7 +311,6 @@ |
311 | 312 | "",
|
312 | 313 | "",
|
313 | 314 | "",
|
314 | | -"",
|
315 | 315 | "",//6F
|
316 | 316 | "",//70
|
317 | 317 | "",
|
— | — | @@ -336,6 +336,7 @@ |
337 | 337 | "",
|
338 | 338 | "",
|
339 | 339 | "",
|
| 340 | +"pixel = pixel & dest;\n",//88 SRCAND
|
340 | 341 | "",
|
341 | 342 | "",
|
342 | 343 | "",
|
— | — | @@ -342,7 +343,6 @@ |
343 | 344 | "",
|
344 | 345 | "",
|
345 | 346 | "",
|
346 | | -"",
|
347 | 347 | "",//8F
|
348 | 348 | "",//90
|
349 | 349 | "",
|
— | — | @@ -387,12 +387,12 @@ |
388 | 388 | "",
|
389 | 389 | "",
|
390 | 390 | "",
|
| 391 | +"pixel = dest | (pixel ^ ivec4(255));\n",//BB MERGEPAINT
|
391 | 392 | "",
|
392 | 393 | "",
|
393 | 394 | "",
|
394 | | -"",
|
395 | 395 | "",//BF
|
396 | | -"",//C0
|
| 396 | +"pixel = pixel & pattern;\n",//C0 MERGECOPY
|
397 | 397 | "",
|
398 | 398 | "",
|
399 | 399 | "",
|
— | — | @@ -438,7 +438,7 @@ |
439 | 439 | "",
|
440 | 440 | "",
|
441 | 441 | "",
|
442 | | -"",
|
| 442 | +"pixel = pixel | dest;\n",//EE SRCPAINT
|
443 | 443 | "",//EF
|
444 | 444 | "pixel = pattern;\n",//F0 PATCOPY
|
445 | 445 | "",
|
— | — | @@ -451,10 +451,10 @@ |
452 | 452 | "",
|
453 | 453 | "",
|
454 | 454 | "",
|
| 455 | +"pixel = dest | pattern | (pixel ^ 255);\n",//FB PATPAINT
|
455 | 456 | "",
|
456 | 457 | "",
|
457 | 458 | "",
|
458 | | -"",
|
459 | 459 | "pixel = ivec4(255);\n",//FF WHITENESS
|
460 | 460 | };
|
461 | 461 |
|
Index: ddraw/glDirectDraw.cpp |
— | — | @@ -962,11 +962,41 @@ |
963 | 963 | DDSCAPS_FRONTBUFFER | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_PALETTE |
|
964 | 964 | DDSCAPS_SYSTEMMEMORY | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE;
|
965 | 965 | ddCaps.dwCKeyCaps = DDCKEYCAPS_SRCBLT;
|
966 | | - memcpy(ddCaps.dwRops,supported_rops,8*sizeof(DWORD));
|
967 | | - memcpy(ddCaps.dwNLVBRops,supported_rops,8*sizeof(DWORD));
|
968 | | - memcpy(ddCaps.dwSSBRops,supported_rops,8*sizeof(DWORD));
|
969 | | - memcpy(ddCaps.dwSVBRops,supported_rops,8*sizeof(DWORD));
|
970 | | - memcpy(ddCaps.dwVSBRops,supported_rops,8*sizeof(DWORD));
|
| 966 | + BOOL fullrop = FALSE;
|
| 967 | + if (!renderer)
|
| 968 | + {
|
| 969 | + HWND hGLWnd = CreateWindow(_T("Test"), NULL, WS_POPUP, 0, 0, 16, 16, NULL, NULL, NULL, NULL);
|
| 970 | + glRenderer *tmprenderer = (glRenderer*)malloc(sizeof(glRenderer));
|
| 971 | + DEVMODE mode;
|
| 972 | + mode.dmSize = sizeof(DEVMODE);
|
| 973 | + EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &mode);
|
| 974 | + glRenderer_Init(tmprenderer, 16, 16, mode.dmBitsPerPel, false, mode.dmDisplayFrequency, hGLWnd, NULL);
|
| 975 | + if (tmprenderer->ext->glver_major >= 3) fullrop = TRUE;
|
| 976 | + if (tmprenderer->ext->GLEXT_EXT_gpu_shader4) fullrop = TRUE;
|
| 977 | + glRenderer_Delete(tmprenderer);
|
| 978 | + free(tmprenderer);
|
| 979 | + }
|
| 980 | + else
|
| 981 | + {
|
| 982 | + if (renderer->ext->glver_major >= 3) fullrop = TRUE;
|
| 983 | + if (renderer->ext->GLEXT_EXT_gpu_shader4) fullrop = TRUE;
|
| 984 | + }
|
| 985 | + if (fullrop)
|
| 986 | + {
|
| 987 | + memcpy(ddCaps.dwRops, supported_rops, 8 * sizeof(DWORD));
|
| 988 | + memcpy(ddCaps.dwNLVBRops, supported_rops, 8 * sizeof(DWORD));
|
| 989 | + memcpy(ddCaps.dwSSBRops, supported_rops, 8 * sizeof(DWORD));
|
| 990 | + memcpy(ddCaps.dwSVBRops, supported_rops, 8 * sizeof(DWORD));
|
| 991 | + memcpy(ddCaps.dwVSBRops, supported_rops, 8 * sizeof(DWORD));
|
| 992 | + }
|
| 993 | + else
|
| 994 | + {
|
| 995 | + memcpy(ddCaps.dwRops, supported_rops_gl2, 8 * sizeof(DWORD));
|
| 996 | + memcpy(ddCaps.dwNLVBRops, supported_rops_gl2, 8 * sizeof(DWORD));
|
| 997 | + memcpy(ddCaps.dwSSBRops, supported_rops_gl2, 8 * sizeof(DWORD));
|
| 998 | + memcpy(ddCaps.dwSVBRops, supported_rops_gl2, 8 * sizeof(DWORD));
|
| 999 | + memcpy(ddCaps.dwVSBRops, supported_rops_gl2, 8 * sizeof(DWORD));
|
| 1000 | + }
|
971 | 1001 | GetAvailableVidMem(NULL,&ddCaps.dwVidMemTotal,&ddCaps.dwVidMemFree);
|
972 | 1002 | if(lpDDDriverCaps)
|
973 | 1003 | {
|