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 |
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 |
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 |
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 |
|
} |
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 |
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 |
|
} |
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 |
|
{ |
1935 |
|
} |
1936 |
|
#endif |
1937 |
|
|
1929 |
– |
#ifdef ENABLE_VOSF |
1938 |
|
static void video_refresh_window_vosf(void) |
1939 |
|
{ |
1940 |
|
// Quit DGA mode if requested |
1959 |
|
#endif |
1960 |
|
} |
1961 |
|
} |
1962 |
< |
#endif |
1962 |
> |
#endif // def ENABLE_VOSF |
1963 |
|
|
1964 |
|
static void video_refresh_window_static(void) |
1965 |
|
{ |
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 |