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

Comparing BasiliskII/src/Unix/video_x.cpp (file contents):
Revision 1.19 by gbeauche, 2000-09-22T17:16:31Z vs.
Revision 1.22 by cebix, 2000-10-08T18:41:35Z

# Line 703 | Line 703 | static bool init_xf86_dga(int width, int
703                  the_buffer = (uint8 *)allocate_framebuffer(the_buffer_size);
704                  memset(the_buffer, 0, the_buffer_size);
705          }
706 < #elif ENABLE_VOSF
707 <        // The UAE memory handlers will already color conversion, if needed.
706 > #elif defined(ENABLE_VOSF)
707 >        // The UAE memory handlers will already handle color conversion, if needed.
708          use_vosf = false;
709   #endif
710          
# Line 1288 | Line 1288 | static void resume_emul(void)
1288          XF86DGASetViewPort(x_display, screen, 0, 0);
1289   #endif
1290          XSync(x_display, false);
1291 <
1292 <        // Restore frame buffer
1293 <        if (fb_save) {
1294 < #if REAL_ADDRESSING || DIRECT_ADDRESSING
1295 <                if (use_vosf)
1296 <                        mprotect((caddr_t)mainBuffer.memStart, mainBuffer.memLength, PROT_READ|PROT_WRITE);
1297 < #endif
1298 <                memcpy(the_buffer, fb_save, VideoMonitor.y * VideoMonitor.bytes_per_row);
1299 < #if REAL_ADDRESSING || DIRECT_ADDRESSING
1300 <                if (use_vosf) {
1301 <                        mprotect((caddr_t)mainBuffer.memStart, mainBuffer.memLength, PROT_READ);
1302 <                        do_update_framebuffer(the_host_buffer, the_buffer, VideoMonitor.x * VideoMonitor.bytes_per_row);
1291 >        
1292 >        // the_buffer already contains the data to restore. i.e. since a temporary
1293 >        // frame buffer is used when VOSF is actually used, fb_save is therefore
1294 >        // not necessary.
1295 > #ifdef ENABLE_VOSF
1296 >        if (use_vosf) {
1297   #ifdef HAVE_PTHREADS
1298 <                        pthread_mutex_lock(&Screen_draw_lock);
1298 >                pthread_mutex_lock(&Screen_draw_lock);
1299   #endif
1300 <                        PFLAG_CLEAR_ALL;
1300 >                PFLAG_SET_ALL;
1301   #ifdef HAVE_PTHREADS
1302 <                        pthread_mutex_unlock(&Screen_draw_lock);
1302 >                pthread_mutex_unlock(&Screen_draw_lock);
1303   #endif
1304 <                }
1304 >                memset(the_buffer_copy, 0, VideoMonitor.bytes_per_row * VideoMonitor.y);
1305 >        }
1306 > #endif
1307 >        
1308 >        // Restore frame buffer
1309 >        if (fb_save) {
1310 > #ifdef ENABLE_VOSF
1311 >                // Don't copy fb_save to the temporary frame buffer in VOSF mode
1312 >                if (!use_vosf)
1313   #endif
1314 +                memcpy(the_buffer, fb_save, VideoMonitor.y * VideoMonitor.bytes_per_row);
1315                  free(fb_save);
1316                  fb_save = NULL;
1317          }
# Line 1590 | Line 1593 | static void handle_events(void)
1593                          case Expose:
1594                                  if (display_type == DISPLAY_WINDOW) {
1595   #ifdef ENABLE_VOSF
1596 <                                        const XExposeEvent & xev = event.xexpose;
1594 <                                        const uint32 start = xev.y * VideoMonitor.bytes_per_row + xev.x;
1595 <                                        const uint32 end = (xev.y + xev.height - 1) * VideoMonitor.bytes_per_row + (xev.x + xev.width);
1596 <                                        int page = start >> mainBuffer.pageBits;
1597 <                                        uint32 addr = start;
1598 <                                        while (addr < end) {
1599 <                                                memset(the_buffer_copy + addr, 0, mainBuffer.pageSize);
1600 <                                                addr += mainBuffer.pageSize;
1596 >                                        if (use_vosf) {                 // VOSF refresh
1597   #ifdef HAVE_PTHREADS
1598                                                  pthread_mutex_lock(&Screen_draw_lock);
1599   #endif
1600 <                                                PFLAG_SET(page);
1600 >                                                PFLAG_SET_ALL;
1601   #ifdef HAVE_PTHREADS
1602                                                  pthread_mutex_unlock(&Screen_draw_lock);
1603   #endif
1604 <                                                ++page;
1604 >                                                memset(the_buffer_copy, 0, VideoMonitor.bytes_per_row * VideoMonitor.y);
1605                                          }
1606 < #else
1606 >                                        else
1607 > #endif
1608                                          if (frame_skip == 0) {  // Dynamic refresh
1609                                                  int x1, y1;
1610                                                  for (y1=0; y1<16; y1++)
1611                                                  for (x1=0; x1<16; x1++)
1612                                                          updt_box[x1][y1] = true;
1613                                                  nr_boxes = 16 * 16;
1614 <                                        } else
1614 >                                        } else                                  // Static refresh
1615                                                  memset(the_buffer_copy, 0, VideoMonitor.bytes_per_row * VideoMonitor.y);
1619 #endif /* ENABLE_VOSF */
1616                                  }
1617                                  break;
1618                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines