- 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
XSync(x_display, false);
// Restore frame buffer
if (fb_save) {
#if REAL_ADDRESSING || DIRECT_ADDRESSING
if (use_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
// the_buffer already contains the data to restore. i.e. since a temporary
// frame buffer is used when VOSF is actually used, fb_save is therefore
// not necessary.
#ifdef ENABLE_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
pthread_mutex_lock(&Screen_draw_lock);
#endif
PFLAG_CLEAR_ALL;
PFLAG_SET_ALL;
#ifdef HAVE_PTHREADS
pthread_mutex_unlock(&Screen_draw_lock);
#endif
memset(the_buffer_copy, 0, VideoMonitor.bytes_per_row * VideoMonitor.y);
}
#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);
fb_save = NULL;
}
@ -1589,24 +1592,27 @@ static void handle_events(void)
// Hidden parts exposed, force complete refresh of window
case Expose:
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
if (use_vosf) { // VOSF refresh
#ifdef HAVE_PTHREADS
pthread_mutex_lock(&Screen_draw_lock);
#endif
PFLAG_SET_ALL;
#ifdef HAVE_PTHREADS
pthread_mutex_unlock(&Screen_draw_lock);
#endif
#endif
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;
}