diff options
author | Aaron Giles <aaron@aarongiles.com> | 2008-04-24 05:32:57 +0000 |
---|---|---|
committer | Aaron Giles <aaron@aarongiles.com> | 2008-04-24 05:32:57 +0000 |
commit | c205e105165880c652f04e44b781de6fdd548ca3 (patch) | |
tree | 8e4bc562fc26485c1e1e4eda0d26536a85b5fc75 | |
parent | b4fd76f1581d562fe35953eb2d59803c890a4454 (diff) |
Fix 01742: punchout, armwrest + many vsnes.c and playch10.c games: Refreshspeed causes fatal exception in punchout.
-rw-r--r-- | src/emu/video.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/emu/video.c b/src/emu/video.c index 4241fa9b24b..9aea274d024 100644 --- a/src/emu/video.c +++ b/src/emu/video.c @@ -1989,11 +1989,13 @@ static void update_refresh_speed(running_machine *machine) UINT32 target_speed; /* 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)) - { - screen_state *state = get_safe_token(screen); - min_frame_period = MIN(min_frame_period, state->frame_period); - } + if (screen->token != NULL) + { + 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 */ target_speed = floor(minrefresh * 100.0 / ATTOSECONDS_TO_HZ(min_frame_period)); |