mirror of
https://github.com/holub/mame
synced 2025-06-25 13:54:37 +03:00
Fix 01742: punchout, armwrest + many vsnes.c and playch10.c games: Refreshspeed causes fatal exception in punchout.
This commit is contained in:
parent
b4fd76f158
commit
c205e10516
@ -1989,11 +1989,13 @@ static void update_refresh_speed(running_machine *machine)
|
|||||||
UINT32 target_speed;
|
UINT32 target_speed;
|
||||||
|
|
||||||
/* find the screen with the shortest frame period (max refresh rate) */
|
/* find the screen with the shortest frame period (max refresh rate) */
|
||||||
|
/* note that we first check the token since this can get called before all screens are created */
|
||||||
for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen))
|
for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen))
|
||||||
{
|
if (screen->token != NULL)
|
||||||
screen_state *state = get_safe_token(screen);
|
{
|
||||||
min_frame_period = MIN(min_frame_period, state->frame_period);
|
screen_state *state = get_safe_token(screen);
|
||||||
}
|
min_frame_period = MIN(min_frame_period, state->frame_period);
|
||||||
|
}
|
||||||
|
|
||||||
/* compute a target speed as an integral percentage */
|
/* compute a target speed as an integral percentage */
|
||||||
target_speed = floor(minrefresh * 100.0 / ATTOSECONDS_TO_HZ(min_frame_period));
|
target_speed = floor(minrefresh * 100.0 / ATTOSECONDS_TO_HZ(min_frame_period));
|
||||||
|
Loading…
Reference in New Issue
Block a user