Added return value to video_screen_update_partial() indicating whether

or not the VIDEO_UPDATE was called as a result.

Modified amiga.c to use this information so that we guarantee a call
to amiga_render_scanline() regardless of the video state.

Fixes 01521: ar_sdwr: Game hangs on title screen
This commit is contained in:
Aaron Giles 2008-03-19 07:58:51 +00:00
parent c44017b4fd
commit d75b3d1dff
3 changed files with 9 additions and 8 deletions

View File

@ -754,10 +754,11 @@ void video_screen_set_visarea(const device_config *screen, int min_x, int max_x,
including the specified scanline including the specified scanline
-------------------------------------------------*/ -------------------------------------------------*/
void video_screen_update_partial(const device_config *screen, int scanline) int video_screen_update_partial(const device_config *screen, int scanline)
{ {
screen_state *state = get_safe_token(screen); screen_state *state = get_safe_token(screen);
rectangle clip = state->visarea; rectangle clip = state->visarea;
int result = FALSE;
/* validate arguments */ /* validate arguments */
assert(scanline >= 0); assert(scanline >= 0);
@ -771,14 +772,14 @@ void video_screen_update_partial(const device_config *screen, int scanline)
if (global.skipping_this_frame) if (global.skipping_this_frame)
{ {
LOG_PARTIAL_UPDATES(("skipped due to frameskipping\n")); LOG_PARTIAL_UPDATES(("skipped due to frameskipping\n"));
return; return FALSE;
} }
/* skip if this screen is not visible anywhere */ /* skip if this screen is not visible anywhere */
if (!render_is_live_screen(screen)) if (!render_is_live_screen(screen))
{ {
LOG_PARTIAL_UPDATES(("skipped because screen not live\n")); LOG_PARTIAL_UPDATES(("skipped because screen not live\n"));
return; return FALSE;
} }
} }
@ -786,7 +787,7 @@ void video_screen_update_partial(const device_config *screen, int scanline)
if (scanline < state->last_partial_scan) if (scanline < state->last_partial_scan)
{ {
LOG_PARTIAL_UPDATES(("skipped because less than previous\n")); LOG_PARTIAL_UPDATES(("skipped because less than previous\n"));
return; return FALSE;
} }
/* set the start/end scanlines */ /* set the start/end scanlines */
@ -810,10 +811,12 @@ void video_screen_update_partial(const device_config *screen, int scanline)
/* if we modified the bitmap, we have to commit */ /* if we modified the bitmap, we have to commit */
state->changed |= ~flags & UPDATE_HAS_NOT_CHANGED; state->changed |= ~flags & UPDATE_HAS_NOT_CHANGED;
result = TRUE;
} }
/* remember where we left off */ /* remember where we left off */
state->last_partial_scan = scanline + 1; state->last_partial_scan = scanline + 1;
return result;
} }

View File

@ -164,7 +164,7 @@ void video_screen_configure(const device_config *screen, int width, int height,
void video_screen_set_visarea(const device_config *screen, int min_x, int max_x, int min_y, int max_y); void video_screen_set_visarea(const device_config *screen, int min_x, int max_x, int min_y, int max_y);
/* force a partial update of the screen up to and including the requested scanline */ /* force a partial update of the screen up to and including the requested scanline */
void video_screen_update_partial(const device_config *screen, int scanline); int video_screen_update_partial(const device_config *screen, int scanline);
/* force an update from the last beam position up to the current beam position */ /* force an update from the last beam position up to the current beam position */
void video_screen_update_now(const device_config *screen); void video_screen_update_now(const device_config *screen);

View File

@ -386,10 +386,8 @@ static TIMER_CALLBACK( scanline_callback )
cia_clock_tod(1); cia_clock_tod(1);
/* render up to this scanline */ /* render up to this scanline */
if (scanline < video_screen_get_visible_area(machine->primary_screen)->min_y) if (!video_screen_update_partial(machine->primary_screen, scanline))
amiga_render_scanline(machine, NULL, scanline); amiga_render_scanline(machine, NULL, scanline);
else
video_screen_update_partial(machine->primary_screen, scanline);
/* force a sound update */ /* force a sound update */
amiga_audio_update(); amiga_audio_update();