PATCH: GetDevCaps() bitdepth flag
Hi there, I work on ZSNES and I was trying to get it working under wine and I ran into a small bug when running under a 32 bit desktop. This fixed a bug in the DeviceGetCaps() function used to return the current bitdepth of the desktop. It is my understanding that X11 returns "24" as the bitdepth while running a 32 bit framebuffer. I have seen in the code where it does change the 24 to 32, but I have discovered a spot where this has been missed. The following is the changes I made, it simply returns 32 if the user has a 24 bit desktop. I could also post code which exposes this bug if needed. *** dlls/x11drv/init.c 2006-03-17 13:05:59.000000000 -0500 --- dlls/x11drv/init.diff 2006-03-17 12:18:05.000000000 -0500 *************** *** 190,196 **** case VERTRES: return screen_height; case BITSPIXEL: ! return screen_depth; case PLANES: return 1; case NUMBRUSHES: --- 190,196 ---- case VERTRES: return screen_height; case BITSPIXEL: ! return (screen_depth == 24) ? 32 : screen_depth; case PLANES: return 1; case NUMBRUSHES: Thanks.
pagefault wrote:
Hi there, I work on ZSNES and I was trying to get it working under wine and I ran into a small bug when running under a 32 bit desktop.
This fixed a bug in the DeviceGetCaps() function used to return the current bitdepth of the desktop. It is my understanding that X11 returns "24" as the bitdepth while running a 32 bit framebuffer. I have seen in the code where it does change the 24 to 32, but I have discovered a spot where this has been missed.
The following is the changes I made, it simply returns 32 if the user has a 24 bit desktop.
I could also post code which exposes this bug if needed.
*** dlls/x11drv/init.c 2006-03-17 13:05:59.000000000 -0500 --- dlls/x11drv/init.diff 2006-03-17 12:18:05.000000000 -0500 *************** *** 190,196 **** case VERTRES: return screen_height; case BITSPIXEL: ! return screen_depth; case PLANES: return 1; case NUMBRUSHES: --- 190,196 ---- case VERTRES: return screen_height; case BITSPIXEL: ! return (screen_depth == 24) ? 32 : screen_depth; case PLANES: return 1; case NUMBRUSHES:
Thanks.
does this actually fix it so that some program works that did not before? I'm not the expert for this area (X-11) but here are a couple of comments. Patches for wine are in "diff -u format and if you want it included to wine it is best submit it to wine-patches(a)winehq.org with a change log. IE: Change log: Fix GetDevCaps for 32 bit screen depth.
Am Samstag, 18. März 2006 02:33 schrieb Tony Lambregts:
pagefault wrote:
Hi there, I work on ZSNES and I was trying to get it working under wine and I ran into a small bug when running under a 32 bit desktop.
This fixed a bug in the DeviceGetCaps() function used to return the current bitdepth of the desktop. It is my understanding that X11 returns "24" as the bitdepth while running a 32 bit framebuffer. I have seen in the code where it does change the 24 to 32, but I have discovered a spot where this has been missed.
The following is the changes I made, it simply returns 32 if the user has a 24 bit desktop.
I could also post code which exposes this bug if needed.
*** dlls/x11drv/init.c 2006-03-17 13:05:59.000000000 -0500 --- dlls/x11drv/init.diff 2006-03-17 12:18:05.000000000 -0500 *************** *** 190,196 **** case VERTRES: return screen_height; case BITSPIXEL: ! return screen_depth; case PLANES: return 1; case NUMBRUSHES: --- 190,196 ---- case VERTRES: return screen_height; case BITSPIXEL: ! return (screen_depth == 24) ? 32 : screen_depth; case PLANES: return 1; case NUMBRUSHES:
Thanks.
does this actually fix it so that some program works that did not before?
I'm not the expert for this area (X-11) but here are a couple of comments. Patches for wine are in "diff -u format and if you want it included to wine it is best submit it to wine-patches(a)winehq.org with a change log. IE:
Change log: Fix GetDevCaps for 32 bit screen depth.
Well, I know at least one problem this patch might fix - with DAZ|Studio. It worked with WINVER=win98, but with w2k or xp, an error message popped up ("DAZ|Studio requires 32bit color depth" or something"), and the program exited. I think more recent versions of DAZ|Studio still give the error message but continue to load. Haven't tested the program in the last few months, though (it's unusable as it uses OpenGL viewports)... -- Willie Sippel //////// | Tritium Studios // | ______________________________ //// /// | http://www.tritium-studios.com <willie(a)froq.net>
Am Freitag, 17. März 2006 20:12 schrieb pagefault:
Hi there, I work on ZSNES and I was trying to get it working under wine and I ran into a small bug when running under a 32 bit desktop.
This fixed a bug in the DeviceGetCaps() function used to return the current bitdepth of the desktop. It is my understanding that X11 returns "24" as the bitdepth while running a 32 bit framebuffer. I have seen in the code where it does change the 24 to 32, but I have discovered a spot where this has been missed.
The following is the changes I made, it simply returns 32 if the user has a 24 bit desktop.
With your patch applied, two applications I tested (Newtek Aura and Bauhaus/ TVPaint Mirage) show an odd bug. Only the window background gets drawn, but all the widgets are missing, or, more precisely, invisible. Both applications use their own toolkit - Mirage is infact Aura's successor, so their drawing code should be very similar. But Aura's used to work, while Mirage's always produced borked results - painting stuff blue and distorted instead of gray. -- Willie Sippel //////// | Tritium Studios // | ______________________________ //// /// | http://www.tritium-studios.com <willie(a)froq.net>
participants (3)
-
pagefault -
Tony Lambregts -
Willie Sippel