- Added video_screen_update_now(int scrnum) to force a screen update up to the current beam position

- Changed Qix driver to use this function
This commit is contained in:
Zsolt Vasvari 2008-02-19 12:27:00 +00:00
parent ccb9e852f9
commit 3d8658108f
3 changed files with 41 additions and 4 deletions

View File

@ -888,6 +888,33 @@ void video_screen_update_partial(int scrnum, int scanline)
}
/*-------------------------------------------------
video_screen_update_partial - perform an update
from the last beam position up to the current
beam position
-------------------------------------------------*/
void video_screen_update_now(int scrnum)
{
internal_screen_info *info = get_screen_info(Machine, scrnum);
int current_vpos = video_screen_get_vpos(scrnum);
int current_hpos = video_screen_get_hpos(scrnum);
/* since we can currently update only at the scanline
level, we are trying to do the right thing by
updating including the current scanline, only if the
beam is past the halfway point horizontally.
If the beam is in the first half of the scanline,
we only update up to the previous scanline.
This minimizes the number of pixels that might be drawn
incorrectly until we support a pixel level granularity */
if ((current_hpos < (info->state->width / 2)) && (current_vpos > 0))
current_vpos = current_vpos - 1;
video_screen_update_partial(scrnum, current_vpos);
}
/*-------------------------------------------------
video_screen_get_vpos - returns the current
vertical position of the beam for a given

View File

@ -92,6 +92,9 @@ void video_screen_set_visarea(int scrnum, int min_x, int max_x, int min_y, int m
/* force a partial update of the screen up to and including the requested scanline */
void video_screen_update_partial(int scrnum, int scanline);
/* force an update from the last beam position up to the current beam position */
void video_screen_update_now(int scrnum);
/* return the current vertical or horizontal position of the beam for a screen */
int video_screen_get_vpos(int scrnum);
int video_screen_get_hpos(int scrnum);

View File

@ -154,7 +154,7 @@ WRITE8_HANDLER( qix_videoram_w )
{
/* update the screen in case the game is writing "behind" the beam -
Zookeeper likes to do this */
video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
video_screen_update_now(0);
/* add in the upper bit of the address latch */
offset += (qix_videoaddress[0] & 0x80) << 8;
@ -219,7 +219,7 @@ WRITE8_HANDLER( qix_paletteram_w )
/* trigger an update if a currently visible pen has changed */
if (((offset >> 8) == qix_palettebank) &&
(old_data != data))
video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
video_screen_update_now(0);
}
@ -228,7 +228,7 @@ WRITE8_HANDLER( qix_palettebank_w )
/* set the bank value */
if (qix_palettebank != (data & 3))
{
video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
video_screen_update_now(0);
qix_palettebank = data & 3;
}
@ -368,11 +368,18 @@ static VIDEO_UPDATE( qix )
}
/*************************************
*
* Machine driver
*
*************************************/
MACHINE_DRIVER_START( qix_video )
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
MDRV_VIDEO_START(qix)
MDRV_VIDEO_UPDATE(qix)
MDRV_DEVICE_ADD("crtc", MC6845, 0)
MDRV_DEVICE_CONFIG(mc6845_intf)