From: Brian J. <bjj...@us...> - 2004-07-27 18:33:24
|
I wrote: > "Thousands" of colors mode squashes the entire > display into the left half of the window, with an odd green cast. > Looks like something's not quite right in the 16bpp blitter... I think I found the problem: BII was trying to use a 32bpp blitter in 16-bit video mode, so only half of the window was getting filled and the colors were in the wrong bit positions. The basic issue was that driver_window::driver_window(SDL_monitor_desc &m) was setting its "depth" variable, which is passed to SDL_SetVideoMode, from screen_depth (which is set at init. time and then never changed.) However, it was passing the requested Mac video depth as the 3rd parameter to Screen_blitter_init(). So that parameter did not match VisualFormat.depth, which broke the assumptions made by Screen_blitter_init(). This seems to fix it: bjjsgi> cvs diff -u SDL/video_sdl.cpp Index: SDL/video_sdl.cpp =================================================================== RCS file: /cvs/BasiliskII/src/SDL/video_sdl.cpp,v retrieving revision 1.9 diff -u -r1.9 video_sdl.cpp --- SDL/video_sdl.cpp 27 Jun 2004 17:31:21 -0000 1.9 +++ SDL/video_sdl.cpp 27 Jul 2004 18:22:20 -0000 @@ -618,7 +618,23 @@ ADBSetRelMouseMode(mouse_grabbed); // Create surface - int depth = (VIDEO_MODE_DEPTH <= VIDEO_DEPTH_8BIT ? 8 : screen_depth); + int depth; + switch (VIDEO_MODE_DEPTH) { + case VIDEO_DEPTH_1BIT: + case VIDEO_DEPTH_2BIT: + case VIDEO_DEPTH_4BIT: + case VIDEO_DEPTH_8BIT: + depth = 8; + break; + case VIDEO_DEPTH_16BIT: + depth = 16; + break; + case VIDEO_DEPTH_32BIT: + depth = 32; + break; + default: + abort(); + } if ((s = SDL_SetVideoMode(width, height, depth, SDL_HWSURFACE)) == NULL) return; It sets depth based on the requested Mac video depth, rather than the init. time SDL default depth. I still have problems changing depths using SGI's Xserver, which supports multiple visuals at multiple depths at once. I get BadMatch errors: Gdk-ERROR **: BadMatch (invalid parameter attributes) serial 1015 error_code 8 request_code 129 minor_code 3 I don't have that problem using Xvnc, which is based on XFree86 and supports only a single visual depth. Any suggestions? Brian -------------------------------------------------------------------- ... He say, "One and one and one is one. The one thing I can tell you is debug till it runs" ... If the Beatles had studied computer science |