From: <gb...@di...> - 2000-09-25 00:17:16
|
Hi, > On Sun, Sep 24, 2000 at 07:21:43PM +0200, Gwenole Beauchesne wrote: > > Here is a patch that disables it. > > This rather makes it worse (see attachment). Arrgl :-/ I now really suspect the problem to be the information contained in the mainBuffer structure. Hadn't there at least one frame (the first one in fact) that was fully and correctly drawed ? Oh, I got an idea. Does the display uses or not X-Shm ? All my tests in windowed mode were carried out with Shm. One difference I see between the_buffer_copy from Shm mode or from no-Shm mode is that in one case width is used to create an XImage, and in the other case, aligned_width is used. Another difference is that the bitmap_pad in the latter case (given to XCreateImage) is 32 whereas aligned_width is aligned on 16-byte boundaries (XShmCreateImage). By the nature of the blit functions, it is important to have the same line width between the "host" buffer, the one created by a call to XShmCreateImage() or XCreateImage(), and the temporary frame buffers. Actually, I think they are identical... at least in X-Shm mode. I also see a potential bug, in init_window() and direct or real addressing mode, VideoMonitor.mac_frame_base is initted to the_buffer. In fact, the alignment of the_buffer on page boundary carried out in VideoInit(), should be done when the_buffer is assigned to VideoMonitor.mac_frame_base. I don't think this is the bug we are currently facing to, however. Otherwise, mprotect() would gently have segfaulted if the address wasn't aligned on page boundary. Have you tried 8bpp DGA mode ? This is bound to work since this is the only mode for a little endian system where VOSF is not involved. I would be really surprised if it still draws weird things... BTW, here is another patch against the sources you now have: It updates the XImage buffer line per line. Please tell me it works now ;-) <--- begin patch 2 ---> --- BasiliskII.orig/src/Unix/video_vosf.h Mon Sep 25 02:03:46 2000 +++ BasiliskII/src/Unix/video_vosf.h Mon Sep 25 02:12:02 2000 @@ -333,10 +333,16 @@ mprotect((caddr_t)(mainBuffer.memStart + offset), length, PROT_READ); #if 1 - do_update_framebuffer(the_host_buffer + offset, the_buffer + offset, length); - const int y1 = mainBuffer.pageInfo[first_page].top; const int y2 = mainBuffer.pageInfo[page - 1].bottom; + + for (int i = y1; i <= y2; i++) { + do_update_framebuffer( + the_host_buffer + i * img->bytes_per_line, + the_buffer + i * VideoMonitor.bytes_per_row, + VideoMonitor.bytes_per_row ); + } + const int width = VideoMonitor.x; const int height = y2 - y1 + 1; if (have_shm) <--- end patch 2 ---> Bye. -- Gwenolé Beauchesne |