mirror of
https://github.com/holub/mame
synced 2025-06-22 20:38:50 +03:00
video_screen_get_vblank() was also incorrect for games with MDRV_SCREEN_VBLANK_TIME, this could easily explain a bunch of changed screenshots.
This commit is contained in:
parent
4bd4eceb06
commit
9626c879db
@ -970,8 +970,11 @@ int video_screen_get_vblank(const device_config *screen)
|
|||||||
{
|
{
|
||||||
screen_state *state = get_safe_token(screen);
|
screen_state *state = get_safe_token(screen);
|
||||||
internal_screen_state *internal_state = (internal_screen_state *)state->private_data;
|
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();
|
attotime current_time = timer_get_time();
|
||||||
|
|
||||||
/* we are in the VBLANK region, compute the time until the end of the current VBLANK period */
|
/* 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);
|
ret = attotime_sub(internal_state->vblank_end_time, current_time);
|
||||||
|
|
||||||
/* otherwise compute the time until the end of the next frame VBLANK period */
|
/* otherwise compute the time until the end of the next frame VBLANK period */
|
||||||
|
Loading…
Reference in New Issue
Block a user