ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/video_vosf.h
(Generate patch)

Comparing BasiliskII/src/Unix/video_vosf.h (file contents):
Revision 1.13 by gbeauche, 2001-01-28T14:05:19Z vs.
Revision 1.15 by cebix, 2001-03-06T18:41:12Z

# Line 117 | Line 117 | static void Screen_fault_handler(int, in
117          do_handle_screen_fault(fault_addr);
118   }
119  
120 + # elif defined(__powerpc__) && defined(__linux__)
121 +
122 + static void Screen_fault_handler(int, struct sigcontext_struct *scs)
123 + {
124 +        D(bug("Screen_fault_handler: ADDR=0x%08X from IP=0x%08X\n", scs->regs->dar, scs->regs->nip));
125 +        do_handle_screen_fault((uintptr)scs->regs->dar, (uintptr)scs->regs->nip);
126 + }
127 +
128   # else
129   #  error "No suitable subterfuge for Video on SEGV signals"
130   # endif
# Line 219 | Line 227 | static inline void update_display_window
227                  
228                  const int bytes_per_row = VideoMonitor.bytes_per_row;
229                  const int bytes_per_pixel = VideoMonitor.bytes_per_row / VideoMonitor.x;
230 <                int i, j;
230 >                int i = y1 * bytes_per_row, j;
231                  
224                // Check for first column from left and first column
225                // from right that have changed
226                int x1, x2, width;
232                  if (depth == 1) {
233  
229                        x1 = VideoMonitor.x - 1;
230                        for (j = y1; j <= y2; j++) {
231                                uint8 * const p1 = &the_buffer[j * bytes_per_row];
232                                uint8 * const p2 = &the_buffer_copy[j * bytes_per_row];
233                                for (i = 0; i < (x1>>3); i++) {
234                                        if (p1[i] != p2[i]) {
235                                                x1 = i << 3;
236                                                break;
237                                        }
238                                }
239                        }
240
241                        x2 = x1;
242                        for (j = y2; j >= y1; j--) {
243                                uint8 * const p1 = &the_buffer[j * bytes_per_row];
244                                uint8 * const p2 = &the_buffer_copy[j * bytes_per_row];
245                                for (i = (VideoMonitor.x>>3) - 1; i > (x2>>3); i--) {
246                                        if (p1[i] != p2[i]) {
247                                                x2 = (i << 3) + 7;
248                                                break;
249                                        }
250                                }
251                        }
252                        width = x2 - x1 + 1;
253
234                          // Update the_host_buffer and copy of the_buffer
255                        i = y1 * bytes_per_row + (x1 >> 3);
235                          for (j = y1; j <= y2; j++) {
236 <                                Screen_blit(the_host_buffer + i, the_buffer + i, width >> 3);
258 <                                memcpy(the_buffer_copy + i, the_buffer + i, width >> 3);
236 >                                Screen_blit(the_host_buffer + i, the_buffer + i, VideoMonitor.x >> 3);
237                                  i += bytes_per_row;
238                          }
239  
240                  } else {
241  
264                        x1 = VideoMonitor.x * bytes_per_pixel - 1;
265                        for (j = y1; j <= y2; j++) {
266                                uint8 * const p1 = &the_buffer[j * bytes_per_row];
267                                uint8 * const p2 = &the_buffer_copy[j * bytes_per_row];
268                                for (i = 0; i < x1; i++) {
269                                        if (p1[i] != p2[i]) {
270                                                x1 = i;
271                                                break;
272                                        }
273                                }
274                        }
275                        x1 /= bytes_per_pixel;
276                
277                        x2 = x1 * bytes_per_pixel;
278                        for (j = y2; j >= y1; j--) {
279                                uint8 * const p1 = &the_buffer[j * bytes_per_row];
280                                uint8 * const p2 = &the_buffer_copy[j * bytes_per_row];
281                                for (i = VideoMonitor.x * bytes_per_pixel - 1; i > x2; i--) {
282                                        if (p1[i] != p2[i]) {
283                                                x2 = i;
284                                                break;
285                                        }
286                                }
287                        }
288                        x2 /= bytes_per_pixel;
289                        width = x2 - x1 + 1;
290
242                          // Update the_host_buffer and copy of the_buffer
292                        i = y1 * bytes_per_row + x1 * bytes_per_pixel;
243                          for (j = y1; j <= y2; j++) {
244 <                                Screen_blit(the_host_buffer + i, the_buffer + i, bytes_per_pixel * width);
295 <                                memcpy(the_buffer_copy + i, the_buffer + i, bytes_per_pixel * width);
244 >                                Screen_blit(the_host_buffer + i, the_buffer + i, bytes_per_pixel * VideoMonitor.x);
245                                  i += bytes_per_row;
246                          }
247                  }
248 <                
248 >
249                  if (have_shm)
250 <                        XShmPutImage(x_display, the_win, the_gc, img, x1, y1, x1, y1, width, height, 0);
250 >                        XShmPutImage(x_display, the_win, the_gc, img, 0, y1, 0, y1, VideoMonitor.x, height, 0);
251                  else
252 <                        XPutImage(x_display, the_win, the_gc, img, x1, y1, x1, y1, width, height);
252 >                        XPutImage(x_display, the_win, the_gc, img, 0, y1, 0, y1, VideoMonitor.x, height);
253          }
254 +
255          mainBuffer.dirty = false;
256   }
257  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines