From b7d1e4746cd43f60df1dfdd5590d52368ff1c33e Mon Sep 17 00:00:00 2001 From: cam900 Date: Thu, 2 Aug 2018 02:45:44 +0900 Subject: aica.cpp : Add notes, Implement EXTS Mixing (#3812) * aica.cpp : Add notes, Implement EXTS Mixing * aica.cpp : Fix EXTS * dccons.cpp : Fix output (tied at AICA EXTS) --- src/devices/sound/aica.cpp | 32 +++++++++++++++++++++++++++++--- src/devices/sound/aica.h | 2 ++ src/devices/sound/aicadsp.cpp | 2 +- src/mame/drivers/dccons.cpp | 4 ++-- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/devices/sound/aica.cpp b/src/devices/sound/aica.cpp index 3c66130fb77..4ad7c2f5995 100644 --- a/src/devices/sound/aica.cpp +++ b/src/devices/sound/aica.cpp @@ -4,10 +4,17 @@ /* Sega/Yamaha AICA emulation + Confirmed Part numbers: + SEGA 315-6232 G21003 (Later) + SEGA 315-6119 FQ1003 (Earlier) + This is effectively a 64-voice SCSP, with the following differences: - No FM mode - A third sample format (ADPCM) has been added - Some minor other tweeks (no EGHOLD, slighly more capable DSP) + + TODO: + - Where are EXTS Connected? */ #include "emu.h" @@ -972,8 +979,8 @@ void aica_device::w16(address_space &space,unsigned int addr,unsigned short val) } else if(addr<0x45c0) *((unsigned short *) (m_DSP.EFREG+(addr-0x4580)/4))=val; - else if(addr<0x45c8) - *((unsigned short *) (m_DSP.EXTS+(addr-0x45c0)/2))=val; + //else if(addr<0x45c8) + // *((unsigned short *) (m_DSP.EXTS+(addr-0x45c0)/2))=val; // Read only } } @@ -1264,10 +1271,13 @@ int32_t aica_device::UpdateSlot(AICA_SLOT *slot) void aica_device::DoMasterSamples(int nsamples) { stream_sample_t *bufr,*bufl; + stream_sample_t *exts[2]; int sl, s, i; bufr=m_bufferr; bufl=m_bufferl; + exts[0]=m_exts0; + exts[1]=m_exts1; for(s=0;s>SHIFT; + smpr+=(m_DSP.EXTS[i]*m_RPANTABLE[Enc])>>SHIFT; + } + } + *bufl++ = (ICLIP16(smpl>>3)*m_LPANTABLE[MVOL()<<0xd])>>SHIFT; *bufr++ = (ICLIP16(smpr>>3)*m_LPANTABLE[MVOL()<<0xd])>>SHIFT; } @@ -1416,6 +1438,8 @@ void aica_device::sound_stream_update(sound_stream &stream, stream_sample_t **in { m_bufferl = outputs[0]; m_bufferr = outputs[1]; + m_exts0 = inputs[0]; + m_exts1 = inputs[1]; m_length = samples; DoMasterSamples(samples); } @@ -1433,7 +1457,7 @@ void aica_device::device_start() m_irq_cb.resolve_safe(); m_main_irq_cb.resolve_safe(); - m_stream = machine().sound().stream_alloc(*this, 0, 2, (int)m_rate); + m_stream = machine().sound().stream_alloc(*this, 2, 2, (int)m_rate); // save state save_item(NAME(m_IrqTimA)); @@ -1529,6 +1553,8 @@ aica_device::aica_device(const machine_config &mconfig, const char *tag, device_ m_mcipd(0), m_bufferl(nullptr), m_bufferr(nullptr), + m_exts0(nullptr), + m_exts1(nullptr), m_length(0), m_RBUFDST(nullptr) diff --git a/src/devices/sound/aica.h b/src/devices/sound/aica.h index 3c78692ee97..957f6a9336f 100644 --- a/src/devices/sound/aica.h +++ b/src/devices/sound/aica.h @@ -206,6 +206,8 @@ private: stream_sample_t *m_bufferl; stream_sample_t *m_bufferr; + stream_sample_t *m_exts0; + stream_sample_t *m_exts1; int m_length; diff --git a/src/devices/sound/aicadsp.cpp b/src/devices/sound/aicadsp.cpp index 8ede8c6822f..4cf56872401 100644 --- a/src/devices/sound/aicadsp.cpp +++ b/src/devices/sound/aicadsp.cpp @@ -161,7 +161,7 @@ void AICADSP::step() else if(IRA<=0x2F) INPUTS=MIXS[IRA-0x20]<<4; //MIXS is 20 bit else if(IRA<=0x31) - INPUTS=0; + INPUTS=EXTS[IRA-0x30]<<8; //EXTS is 16 bit INPUTS<<=8; INPUTS>>=8; diff --git a/src/mame/drivers/dccons.cpp b/src/mame/drivers/dccons.cpp index 7735b9f98bc..41997c7fa2c 100644 --- a/src/mame/drivers/dccons.cpp +++ b/src/mame/drivers/dccons.cpp @@ -577,8 +577,8 @@ INPUT_PORTS_END void dc_cons_state::gdrom_config(device_t *device) { device = device->subdevice("cdda"); - MCFG_SOUND_ROUTE(0, "^^lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "^^rspeaker", 1.0) + MCFG_SOUND_ROUTE(0, "^^aica", 1.0) + MCFG_SOUND_ROUTE(1, "^^aica", 1.0) } MACHINE_CONFIG_START(dc_cons_state::dc) -- cgit v1.2.3