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.20 by gbeauche, 2000-09-25T21:49:19Z vs.
Revision 1.23 by cebix, 2000-10-09T17:05:17Z

# Line 583 | Line 583 | static bool init_fbdev_dga(char *in_fb_n
583                  }
584          }
585          
586 + #if ENABLE_VOSF
587   #if REAL_ADDRESSING || DIRECT_ADDRESSING
588          // If the blit function is null, i.e. just a copy of the buffer,
589          // we first try to avoid the allocation of a temporary frame buffer
# Line 599 | Line 600 | static bool init_fbdev_dga(char *in_fb_n
600                  the_buffer = (uint8 *)allocate_framebuffer(the_buffer_size);
601                  memset(the_buffer, 0, the_buffer_size);
602          }
603 < #elif ENABLE_VOSF
603 > #else
604          use_vosf = false;
605   #endif
606 + #endif
607          
608          set_video_monitor(width, height, bytes_per_row, true);
609   #if REAL_ADDRESSING || DIRECT_ADDRESSING
# Line 703 | Line 705 | static bool init_xf86_dga(int width, int
705                  the_buffer = (uint8 *)allocate_framebuffer(the_buffer_size);
706                  memset(the_buffer, 0, the_buffer_size);
707          }
708 < #elif ENABLE_VOSF
708 > #elif defined(ENABLE_VOSF)
709          // The UAE memory handlers will already handle color conversion, if needed.
710          use_vosf = false;
711   #endif
# Line 1288 | Line 1290 | static void resume_emul(void)
1290          XF86DGASetViewPort(x_display, screen, 0, 0);
1291   #endif
1292          XSync(x_display, false);
1293 <
1294 <        // Restore frame buffer
1295 <        if (fb_save) {
1296 < #if REAL_ADDRESSING || DIRECT_ADDRESSING
1297 <                if (use_vosf)
1298 <                        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);
1293 >        
1294 >        // the_buffer already contains the data to restore. i.e. since a temporary
1295 >        // frame buffer is used when VOSF is actually used, fb_save is therefore
1296 >        // not necessary.
1297 > #ifdef ENABLE_VOSF
1298 >        if (use_vosf) {
1299   #ifdef HAVE_PTHREADS
1300 <                        pthread_mutex_lock(&Screen_draw_lock);
1300 >                pthread_mutex_lock(&Screen_draw_lock);
1301   #endif
1302 <                        PFLAG_CLEAR_ALL;
1302 >                PFLAG_SET_ALL;
1303   #ifdef HAVE_PTHREADS
1304 <                        pthread_mutex_unlock(&Screen_draw_lock);
1304 >                pthread_mutex_unlock(&Screen_draw_lock);
1305   #endif
1306 <                }
1306 >                memset(the_buffer_copy, 0, VideoMonitor.bytes_per_row * VideoMonitor.y);
1307 >        }
1308 > #endif
1309 >        
1310 >        // Restore frame buffer
1311 >        if (fb_save) {
1312 > #ifdef ENABLE_VOSF
1313 >                // Don't copy fb_save to the temporary frame buffer in VOSF mode
1314 >                if (!use_vosf)
1315   #endif
1316 +                memcpy(the_buffer, fb_save, VideoMonitor.y * VideoMonitor.bytes_per_row);
1317                  free(fb_save);
1318                  fb_save = NULL;
1319          }
# Line 1589 | Line 1594 | static void handle_events(void)
1594                          // Hidden parts exposed, force complete refresh of window
1595                          case Expose:
1596                                  if (display_type == DISPLAY_WINDOW) {
1592                                        if (frame_skip == 0) {  // Dynamic refresh
1593                                                int x1, y1;
1594                                                for (y1=0; y1<16; y1++)
1595                                                for (x1=0; x1<16; x1++)
1596                                                        updt_box[x1][y1] = true;
1597                                                nr_boxes = 16 * 16;
1598                                        } else {
1597   #ifdef ENABLE_VOSF
1598 +                                        if (use_vosf) {                 // VOSF refresh
1599   #ifdef HAVE_PTHREADS
1600                                                  pthread_mutex_lock(&Screen_draw_lock);
1601   #endif
# Line 1604 | Line 1603 | static void handle_events(void)
1603   #ifdef HAVE_PTHREADS
1604                                                  pthread_mutex_unlock(&Screen_draw_lock);
1605   #endif
1607 #endif
1606                                                  memset(the_buffer_copy, 0, VideoMonitor.bytes_per_row * VideoMonitor.y);
1607                                          }
1608 +                                        else
1609 + #endif
1610 +                                        if (frame_skip == 0) {  // Dynamic refresh
1611 +                                                int x1, y1;
1612 +                                                for (y1=0; y1<16; y1++)
1613 +                                                for (x1=0; x1<16; x1++)
1614 +                                                        updt_box[x1][y1] = true;
1615 +                                                nr_boxes = 16 * 16;
1616 +                                        } else                                  // Static refresh
1617 +                                                memset(the_buffer_copy, 0, VideoMonitor.bytes_per_row * VideoMonitor.y);
1618                                  }
1619                                  break;
1620                  }
# Line 1899 | Line 1907 | static void video_refresh_dga(void)
1907          handle_palette_changes(depth, DISPLAY_DGA);
1908   }
1909  
1910 + #ifdef ENABLE_VOSF
1911   #if REAL_ADDRESSING || DIRECT_ADDRESSING
1912   static void video_refresh_dga_vosf(void)
1913   {
# Line 1926 | Line 1935 | static void video_refresh_dga_vosf(void)
1935   }
1936   #endif
1937  
1929 #ifdef ENABLE_VOSF
1938   static void video_refresh_window_vosf(void)
1939   {
1940          // Quit DGA mode if requested
# Line 1951 | Line 1959 | static void video_refresh_window_vosf(vo
1959   #endif
1960          }
1961   }
1962 < #endif
1962 > #endif // def ENABLE_VOSF
1963  
1964   static void video_refresh_window_static(void)
1965   {
# Line 1992 | Line 2000 | void VideoRefreshInit(void)
2000   {
2001          // TODO: set up specialised 8bpp VideoRefresh handlers ?
2002          if (display_type == DISPLAY_DGA) {
2003 < #if REAL_ADDRESSING || DIRECT_ADDRESSING
2003 > #if ENABLE_VOSF && (REAL_ADDRESSING || DIRECT_ADDRESSING)
2004                  if (use_vosf)
2005                          video_refresh = video_refresh_dga_vosf;
2006                  else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines