diff options
-rw-r--r-- | src/emu/video.c | 27 | ||||
-rw-r--r-- | src/emu/video.h | 3 | ||||
-rw-r--r-- | src/mame/video/qix.c | 15 |
3 files changed, 41 insertions, 4 deletions
diff --git a/src/emu/video.c b/src/emu/video.c index 0399f84811a..933f1af623c 100644 --- a/src/emu/video.c +++ b/src/emu/video.c @@ -889,6 +889,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 screen diff --git a/src/emu/video.h b/src/emu/video.h index 0d455ac120a..f50b519975a 100644 --- a/src/emu/video.h +++ b/src/emu/video.h @@ -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); diff --git a/src/mame/video/qix.c b/src/mame/video/qix.c index 0ac5b5398b4..ae1dfd350a4 100644 --- a/src/mame/video/qix.c +++ b/src/mame/video/qix.c @@ -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) |