- fixed a bug in the previous patch that would fail to redraw the screen if

dynamic refresh is used.
- cleaned up resume_emul() in DGA mode with VOSF.
This commit is contained in:
gbeauche 2000-09-25 22:33:49 +00:00
parent 48f9ee5477
commit 147f72cb41

View File

@ -1289,26 +1289,29 @@ static void resume_emul(void)
#endif #endif
XSync(x_display, false); XSync(x_display, false);
// Restore frame buffer // the_buffer already contains the data to restore. i.e. since a temporary
if (fb_save) { // frame buffer is used when VOSF is actually used, fb_save is therefore
#if REAL_ADDRESSING || DIRECT_ADDRESSING // not necessary.
if (use_vosf) #ifdef ENABLE_VOSF
mprotect((caddr_t)mainBuffer.memStart, mainBuffer.memLength, PROT_READ|PROT_WRITE);
#endif
memcpy(the_buffer, fb_save, VideoMonitor.y * VideoMonitor.bytes_per_row);
#if REAL_ADDRESSING || DIRECT_ADDRESSING
if (use_vosf) { if (use_vosf) {
mprotect((caddr_t)mainBuffer.memStart, mainBuffer.memLength, PROT_READ);
do_update_framebuffer(the_host_buffer, the_buffer, VideoMonitor.x * VideoMonitor.bytes_per_row);
#ifdef HAVE_PTHREADS #ifdef HAVE_PTHREADS
pthread_mutex_lock(&Screen_draw_lock); pthread_mutex_lock(&Screen_draw_lock);
#endif #endif
PFLAG_CLEAR_ALL; PFLAG_SET_ALL;
#ifdef HAVE_PTHREADS #ifdef HAVE_PTHREADS
pthread_mutex_unlock(&Screen_draw_lock); pthread_mutex_unlock(&Screen_draw_lock);
#endif #endif
memset(the_buffer_copy, 0, VideoMonitor.bytes_per_row * VideoMonitor.y);
} }
#endif #endif
// Restore frame buffer
if (fb_save) {
#ifdef ENABLE_VOSF
// Don't copy fb_save to the temporary frame buffer in VOSF mode
if (!use_vosf)
#endif
memcpy(the_buffer, fb_save, VideoMonitor.y * VideoMonitor.bytes_per_row);
free(fb_save); free(fb_save);
fb_save = NULL; fb_save = NULL;
} }
@ -1589,24 +1592,27 @@ static void handle_events(void)
// Hidden parts exposed, force complete refresh of window // Hidden parts exposed, force complete refresh of window
case Expose: case Expose:
if (display_type == DISPLAY_WINDOW) { if (display_type == DISPLAY_WINDOW) {
if (frame_skip == 0) { // Dynamic refresh
int x1, y1;
for (y1=0; y1<16; y1++)
for (x1=0; x1<16; x1++)
updt_box[x1][y1] = true;
nr_boxes = 16 * 16;
} else {
#ifdef ENABLE_VOSF #ifdef ENABLE_VOSF
if (use_vosf) { // VOSF refresh
#ifdef HAVE_PTHREADS #ifdef HAVE_PTHREADS
pthread_mutex_lock(&Screen_draw_lock); pthread_mutex_lock(&Screen_draw_lock);
#endif #endif
PFLAG_SET_ALL; PFLAG_SET_ALL;
#ifdef HAVE_PTHREADS #ifdef HAVE_PTHREADS
pthread_mutex_unlock(&Screen_draw_lock); pthread_mutex_unlock(&Screen_draw_lock);
#endif
#endif #endif
memset(the_buffer_copy, 0, VideoMonitor.bytes_per_row * VideoMonitor.y); memset(the_buffer_copy, 0, VideoMonitor.bytes_per_row * VideoMonitor.y);
} }
else
#endif
if (frame_skip == 0) { // Dynamic refresh
int x1, y1;
for (y1=0; y1<16; y1++)
for (x1=0; x1<16; x1++)
updt_box[x1][y1] = true;
nr_boxes = 16 * 16;
} else // Static refresh
memset(the_buffer_copy, 0, VideoMonitor.bytes_per_row * VideoMonitor.y);
} }
break; break;
} }