From 39c358476c38dc0e53a9c3ace4223b5e9e1c08f3 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Sat, 4 Feb 2012 19:58:03 +0000 Subject: [PATCH] Fix cliffhgr. tms9928a depends on the screen parameters matching output exactly, but for ld games it doesn't since they are externally clocked. --- src/emu/video/tms9928a.c | 6 ++++-- src/emu/video/tms9928a.h | 1 + src/mame/drivers/cliffhgr.c | 10 +--------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/emu/video/tms9928a.c b/src/emu/video/tms9928a.c index d5f1a86d00b..96161b5b5a1 100644 --- a/src/emu/video/tms9928a.c +++ b/src/emu/video/tms9928a.c @@ -274,7 +274,8 @@ WRITE8_MEMBER( tms9928a_device::register_write ) void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { - int vpos = m_screen->vpos(); + int raw_vpos = m_screen->vpos(); + int vpos = raw_vpos * m_vertical_size / m_screen->height(); UINT16 BackColour = m_Regs[7] & 15; UINT16 *p = &m_tmpbmp.pix16(vpos); @@ -567,7 +568,7 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par } /* Schedule next callback */ - m_line_timer->adjust( m_screen->time_until_pos( ( vpos + 1 ) % m_screen->height() , 0 ) ); + m_line_timer->adjust( m_screen->time_until_pos( ( raw_vpos + 1 ) % m_screen->height() , 0 ) ); } @@ -602,6 +603,7 @@ void tms9928a_device::device_start() assert( m_screen != NULL ); m_top_border = m_50hz ? TMS9928A_VERT_DISPLAY_START_PAL : TMS9928A_VERT_DISPLAY_START_NTSC; + m_vertical_size = m_50hz ? TMS9928A_TOTAL_VERT_PAL : TMS9928A_TOTAL_VERT_NTSC; m_irq_changed.resolve( m_out_int_line, *this ); diff --git a/src/emu/video/tms9928a.h b/src/emu/video/tms9928a.h index f5cd1542d8f..d5240d631c2 100644 --- a/src/emu/video/tms9928a.h +++ b/src/emu/video/tms9928a.h @@ -153,6 +153,7 @@ private: /* emulation settings */ int m_top_border; + int m_vertical_size; }; diff --git a/src/mame/drivers/cliffhgr.c b/src/mame/drivers/cliffhgr.c index 28c44cc6373..5533924dc44 100644 --- a/src/mame/drivers/cliffhgr.c +++ b/src/mame/drivers/cliffhgr.c @@ -671,14 +671,6 @@ static TMS9928A_INTERFACE(cliffhgr_tms9928a_interface) DEVCB_LINE(vdp_interrupt) }; -static SCREEN_UPDATE_IND16( cliffhgr ) -{ - tms9928a_device *tms9928a = screen.machine().device( "tms9928a" ); - - tms9928a->screen_update( screen, bitmap, cliprect ); - return 0; -} - DISCRETE_SOUND_EXTERN( cliffhgr ); @@ -701,7 +693,7 @@ static MACHINE_CONFIG_START( cliffhgr, cliffhgr_state ) MCFG_NVRAM_ADD_0FILL("nvram") MCFG_LASERDISC_PR8210_ADD("laserdisc") - MCFG_LASERDISC_OVERLAY_STATIC(TMS9928A_TOTAL_HORZ, TMS9928A_TOTAL_VERT_NTSC, cliffhgr) + MCFG_LASERDISC_OVERLAY_DEVICE(TMS9928A_TOTAL_HORZ, TMS9928A_TOTAL_VERT_NTSC, "tms9928a", tms9928a_device, screen_update) MCFG_LASERDISC_OVERLAY_CLIP(TMS9928A_HORZ_DISPLAY_START-12, TMS9928A_HORZ_DISPLAY_START+32*8+12-1, TMS9928A_VERT_DISPLAY_START_NTSC - 12, TMS9928A_VERT_DISPLAY_START_NTSC+24*8+12-1) /* start with the TMS9928a video configuration */