From 9bab919b0688074aa97f747285c0828dd8250a2d Mon Sep 17 00:00:00 2001 From: AJR Date: Sat, 28 Jan 2017 22:54:34 -0500 Subject: [PATCH] gcpinbal: Add HCT157 --- src/mame/drivers/gcpinbal.cpp | 9 +++++++-- src/mame/includes/gcpinbal.h | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/gcpinbal.cpp b/src/mame/drivers/gcpinbal.cpp index a495ec75730..416ca126619 100644 --- a/src/mame/drivers/gcpinbal.cpp +++ b/src/mame/drivers/gcpinbal.cpp @@ -254,6 +254,8 @@ WRITE16_MEMBER(gcpinbal_state::ioc_w) /* Controlled through ioc? */ WRITE_LINE_MEMBER(gcpinbal_state::gcp_adpcm_int) { + if (!state) + return; if (m_adpcm_idle) m_msm->reset_w(1); if (m_adpcm_start >= 0x200000 || m_adpcm_start > m_adpcm_end) @@ -266,8 +268,8 @@ WRITE_LINE_MEMBER(gcpinbal_state::gcp_adpcm_int) { uint8_t *ROM = memregion("msm")->base(); - m_adpcm_data = ((m_adpcm_trigger ? (ROM[m_adpcm_start] & 0x0f) : (ROM[m_adpcm_start] & 0xf0) >> 4)); - m_msm->data_w(m_adpcm_data & 0xf); + m_adpcm_select->ab_w(ROM[m_adpcm_start]); + m_adpcm_select->select_w(m_adpcm_trigger); m_adpcm_trigger ^= 1; if (m_adpcm_trigger == 0) m_adpcm_start++; @@ -497,6 +499,9 @@ static MACHINE_CONFIG_START( gcpinbal, gcpinbal_state ) MCFG_OKIM6295_ADD("oki", XTAL_1_056MHz, OKIM6295_PIN7_HIGH) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) + MCFG_DEVICE_ADD("adpcm_select", HCT157, 0) + MCFG_74157_OUT_CB(DEVWRITE8("msm", msm6585_device, data_w)) + MCFG_SOUND_ADD("msm", MSM6585, XTAL_640kHz) MCFG_MSM6585_VCLK_CB(WRITELINE(gcpinbal_state, gcp_adpcm_int)) /* VCK function */ MCFG_MSM6585_PRESCALER_SELECTOR(MSM6585_S40) /* 16 kHz */ diff --git a/src/mame/includes/gcpinbal.h b/src/mame/includes/gcpinbal.h index 92346a6f767..fc3e0d2b08a 100644 --- a/src/mame/includes/gcpinbal.h +++ b/src/mame/includes/gcpinbal.h @@ -1,6 +1,7 @@ // license:BSD-3-Clause // copyright-holders:David Graves, R. Belmont +#include "machine/74157.h" #include "sound/okim6295.h" #include "sound/msm5205.h" #include "video/excellent_spr.h" @@ -19,6 +20,7 @@ public: m_maincpu(*this, "maincpu"), m_oki(*this, "oki"), m_msm(*this, "msm"), + m_adpcm_select(*this, "adpcm_select"), m_tilemapram(*this, "tilemapram"), m_ioc_ram(*this, "ioc_ram"), m_gfxdecode(*this, "gfxdecode"), @@ -30,6 +32,7 @@ public: required_device m_maincpu; required_device m_oki; required_device m_msm; + required_device m_adpcm_select; /* memory pointers */ required_shared_ptr m_tilemapram;