From 2d844fe392ac25a555a212c06d6dd1ea39083a57 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Mon, 7 Jan 2008 03:29:59 +0000 Subject: [PATCH] Turned down the aggression on the "don't reconfigure screen" kludge in the TMS34010 core. Fixes stonebal0117u2gre. Also fixed minor cosmetic bug in last Williams sound update. --- src/emu/cpu/tms34010/tms34010.c | 22 ++++++++++++++++++++-- src/mame/machine/midyunit.c | 4 ++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c index 6fa3785455b..cf2365e1175 100644 --- a/src/emu/cpu/tms34010/tms34010.c +++ b/src/emu/cpu/tms34010/tms34010.c @@ -60,6 +60,7 @@ typedef struct tms34010_regs UINT8 pixelshift; UINT8 is_34020; UINT8 reset_deferred; + UINT8 hblank_stable; int (*irq_callback)(int irqline); const tms34010_config *config; emu_timer *scantimer; @@ -1007,9 +1008,14 @@ static TIMER_CALLBACK( scanline_callback ) if (visarea.min_x < visarea.max_x && visarea.max_x <= width && visarea.min_y < visarea.max_y && visarea.max_y <= height) { /* because many games play with the HEBLNK/HSBLNK for effects, we don't change - if they are the only thing that has changed */ - if (width != screen->width || height != screen->height || visarea.min_y != screen->visarea.min_y || visarea.max_y != screen->visarea.max_y) + if they are the only thing that has changed, unless they are stable for a couple + of frames */ + if (width != screen->width || height != screen->height || visarea.min_y != screen->visarea.min_y || visarea.max_y != screen->visarea.max_y || + (state.hblank_stable > 2 && (visarea.min_x != screen->visarea.min_x || visarea.max_x != screen->visarea.max_x))) + { video_screen_configure(state.config->scrnum, width, height, &visarea, refresh); + } + state.hblank_stable++; } LOG(("Configuring screen: HTOTAL=%3d BLANK=%3d-%3d VTOTAL=%3d BLANK=%3d-%3d refresh=%f\n", @@ -1269,6 +1275,12 @@ WRITE16_HANDLER( tms34010_io_register_w ) if (!(data & TMS34010_DI)) IOREG(REG_INTPEND) &= ~TMS34010_DI; break; + + case REG_HEBLNK: + case REG_HSBLNK: + if (oldreg != data) + state.hblank_stable = 0; + break; } if (LOG_CONTROL_REGS) @@ -1447,6 +1459,12 @@ WRITE16_HANDLER( tms34020_io_register_w ) case REG020_DPYADR: case REG020_DPYTAP: break; + + case REG020_HEBLNK: + case REG020_HSBLNK: + if (oldreg != data) + state.hblank_stable = 0; + break; } } diff --git a/src/mame/machine/midyunit.c b/src/mame/machine/midyunit.c index 888940ebb35..a1d87b89da4 100644 --- a/src/mame/machine/midyunit.c +++ b/src/mame/machine/midyunit.c @@ -565,12 +565,12 @@ WRITE16_HANDLER( midyunit_sound_w ) case SOUND_CVSD_SMALL: case SOUND_CVSD: - williams_cvsd_reset_w((~data & 0x100) >> 1); + williams_cvsd_reset_w((~data & 0x100) >> 8); williams_cvsd_data_w((data & 0xff) | ((data & 0x200) >> 1)); break; case SOUND_ADPCM: - williams_adpcm_reset_w((~data & 0x100) >> 1); + williams_adpcm_reset_w((~data & 0x100) >> 8); williams_adpcm_data_w(data); break;