From 9626c879db05f85f0a42c40cc44b586d904a0837 Mon Sep 17 00:00:00 2001 From: Zsolt Vasvari Date: Wed, 12 Mar 2008 12:19:43 +0000 Subject: [PATCH] video_screen_get_vblank() was also incorrect for games with MDRV_SCREEN_VBLANK_TIME, this could easily explain a bunch of changed screenshots. --- src/emu/video.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/emu/video.c b/src/emu/video.c index 2be8c902981..c06969396bc 100644 --- a/src/emu/video.c +++ b/src/emu/video.c @@ -970,8 +970,11 @@ int video_screen_get_vblank(const device_config *screen) { screen_state *state = get_safe_token(screen); internal_screen_state *internal_state = (internal_screen_state *)state->private_data; - int vpos = video_screen_get_vpos(screen); - return (vpos < internal_state->visarea.min_y || vpos > internal_state->visarea.max_y); + + /* we should never be called with no VBLANK period - indication of a buggy driver */ + assert(internal_state->vblank_period != 0); + + return (attotime_compare(timer_get_time(), internal_state->vblank_end_time) < 0); } @@ -1085,7 +1088,7 @@ attotime video_screen_get_time_until_vblank_end(const device_config *screen) attotime current_time = timer_get_time(); /* we are in the VBLANK region, compute the time until the end of the current VBLANK period */ - if (attotime_compare(current_time, internal_state->vblank_end_time) < 0) + if (video_screen_get_vblank(screen)) ret = attotime_sub(internal_state->vblank_end_time, current_time); /* otherwise compute the time until the end of the next frame VBLANK period */