summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Zsolt Vasvari <zsoltvas@mamedev.org>2008-03-12 12:19:43 +0000
committer Zsolt Vasvari <zsoltvas@mamedev.org>2008-03-12 12:19:43 +0000
commit9626c879db05f85f0a42c40cc44b586d904a0837 (patch)
tree7f6bd4b9a51e3e12c5ac760ac90cee8a79d8714a /src
parent4bd4eceb06ddcc1474cdf95b5094229ae38ef2c5 (diff)
video_screen_get_vblank() was also incorrect for games with MDRV_SCREEN_VBLANK_TIME, this could easily explain a bunch of changed screenshots.
Diffstat (limited to 'src')
-rw-r--r--src/emu/video.c9
1 files 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 */