diff --git a/src/emu/sound/l7a1045_l6028_dsp_a.c b/src/emu/sound/l7a1045_l6028_dsp_a.c index 9474973893a..56d42ce6b60 100644 --- a/src/emu/sound/l7a1045_l6028_dsp_a.c +++ b/src/emu/sound/l7a1045_l6028_dsp_a.c @@ -172,6 +172,8 @@ WRITE16_MEMBER( l7a1045_sound_device::l7a1045_sound_w ) if(offset == 0) sound_select_w(space, offset, data, mem_mask); + else if(offset == 8/2) + sound_status_w(space, offset, data, mem_mask); else sound_data_w(space,offset - 1,data,mem_mask); } @@ -225,32 +227,33 @@ WRITE16_MEMBER(l7a1045_sound_device::sound_data_w) m_audiodat[m_audioregister][m_audiochannel].dat[offset] = data; - if(offset == 0) - { - switch (m_audioregister) { - case 0x00: - // hack - l7a1045_voice *vptr = &m_voice[m_audiochannel]; + case 0x00: + l7a1045_voice *vptr = &m_voice[m_audiochannel]; - m_key |= 1 << m_audiochannel; + vptr->start = (m_audiodat[0][m_audiochannel].dat[2] & 0x000f) << (16 + 4); + vptr->start |= (m_audiodat[0][m_audiochannel].dat[1] & 0xffff) << (4); + vptr->start |= (m_audiodat[0][m_audiochannel].dat[0] & 0xf000) >> (12); + + vptr->start &= m_rom_size - 1; + + //printf("%08x: REGISTER 00 write port 0x0002 chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); + break; + } +} + +WRITE16_MEMBER(l7a1045_sound_device::sound_status_w) +{ + if(data & 0x100) // keyin + { + l7a1045_voice *vptr = &m_voice[m_audiochannel]; vptr->frac = 0; vptr->pos = 0; - - vptr->start = (m_audiodat[0][m_audiochannel].dat[2] & 0x000f) << (16 + 4); - vptr->start |= (m_audiodat[0][m_audiochannel].dat[1] & 0xffff) << (4); - vptr->start |= (m_audiodat[0][m_audiochannel].dat[0] & 0xf000) >> (12); - - vptr->start &= m_rom_size - 1; - - //printf("%08x: REGISTER 00 write port 0x0002 chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); - break; + m_key |= 1 << m_audiochannel; } } -} - READ16_MEMBER(l7a1045_sound_device::l7a1045_sound_port_0004_r) { diff --git a/src/emu/sound/l7a1045_l6028_dsp_a.h b/src/emu/sound/l7a1045_l6028_dsp_a.h index cd31cfe0892..22f88928ced 100644 --- a/src/emu/sound/l7a1045_l6028_dsp_a.h +++ b/src/emu/sound/l7a1045_l6028_dsp_a.h @@ -57,6 +57,7 @@ private: DECLARE_WRITE16_MEMBER(sound_select_w); DECLARE_WRITE16_MEMBER(sound_data_w); + DECLARE_WRITE16_MEMBER(sound_status_w); DECLARE_READ16_MEMBER(l7a1045_sound_port_0004_r); DECLARE_READ16_MEMBER(l7a1045_sound_port_0006_r); diff --git a/src/mame/audio/hng64.c b/src/mame/audio/hng64.c index 982bc9b0e02..5e8b6827ce3 100644 --- a/src/mame/audio/hng64.c +++ b/src/mame/audio/hng64.c @@ -194,7 +194,9 @@ WRITE16_MEMBER(hng64_state::hng64_sound_port_0008_w) // logerror("hng64_sound_port_0008_w %04x %04x\n", data, mem_mask); // seems to one or more of the DMARQ on the V53, writes here when it expects DMA channel 3 to transfer ~0x20 bytes just after startup + /* TODO: huh? */ m_audiocpu->dreq3_w(data&1); + m_dsp->l7a1045_sound_w(space,8/2,data,mem_mask); // m_audiocpu->hack_w(1); } @@ -276,7 +278,7 @@ WRITE16_MEMBER(hng64_state::sound_comms_w) printf("IRQ ACK %02x?\n",data); return; } - + printf("SOUND W %02x %04x\n",offset*2,data); } @@ -290,7 +292,7 @@ READ16_MEMBER(hng64_state::sound_comms_r) return main_latch[1]; } printf("SOUND R %02x\n",offset*2); - + return 0; } @@ -356,14 +358,14 @@ WRITE_LINE_MEMBER(hng64_state::tcu_tm2_cb) if(machine().input().code_pressed_once(KEYCODE_X)) i--; - + if(i < 0) i = 0; if(i > 7) i = 7; printf("trigger %02x %d\n",i,state); - + //if(machine().input().code_pressed_once(KEYCODE_C)) { m_audiocpu->set_input_line(i, state? ASSERT_LINE :CLEAR_LINE); diff --git a/src/mame/includes/hng64.h b/src/mame/includes/hng64.h index 9ae7d6d034b..498e6dca0ba 100644 --- a/src/mame/includes/hng64.h +++ b/src/mame/includes/hng64.h @@ -104,6 +104,7 @@ public: : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), + m_dsp(*this, "l7a1045"), m_comm(*this, "network"), m_rtc(*this, "rtc"), m_mainram(*this, "mainram"), @@ -129,8 +130,10 @@ public: required_device m_maincpu; required_device m_audiocpu; + required_device m_dsp; required_device m_comm; required_device m_rtc; + required_shared_ptr m_mainram; required_shared_ptr m_cart; required_shared_ptr m_sysregs;