Added keyin, because yes.

This commit is contained in:
angelosa 2015-04-05 20:45:14 +02:00
parent 212aff689f
commit f8b8fd5238
4 changed files with 31 additions and 22 deletions

View File

@ -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)
{

View File

@ -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);

View File

@ -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);

View File

@ -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<mips3_device> m_maincpu;
required_device<v53a_device> m_audiocpu;
required_device<l7a1045_sound_device> m_dsp;
required_device<cpu_device> m_comm;
required_device<msm6242_device> m_rtc;
required_shared_ptr<UINT32> m_mainram;
required_shared_ptr<UINT32> m_cart;
required_shared_ptr<UINT32> m_sysregs;