mpc3000: pass startup DMA tests, now waiting on boot floppy (nw)

This commit is contained in:
arbee 2018-08-12 22:29:30 -04:00
parent 6fba1e6bab
commit 9bc6e6f3cf
3 changed files with 81 additions and 4 deletions

View File

@ -207,6 +207,8 @@ WRITE16_MEMBER( l7a1045_sound_device::l7a1045_sound_w )
{
m_stream->update(); // TODO
//logerror("%s: %x to %x (mask %04x)\n", tag(), data, offset, mem_mask);
if(offset == 0)
sound_select_w(space, offset, data, mem_mask);
else if(offset == 8/2)
@ -220,6 +222,8 @@ READ16_MEMBER( l7a1045_sound_device::l7a1045_sound_r )
{
m_stream->update();
//logerror("%s: read at %x (mask %04x)\n", tag(), offset, mem_mask);
if(offset == 0)
printf("sound_select_r?\n");
else
@ -261,6 +265,8 @@ WRITE16_MEMBER(l7a1045_sound_device::sound_data_w)
m_audiodat[m_audioregister][m_audiochannel].dat[offset] = data;
//logerror("%s: %x to ch %d reg %d\n", tag(), data, m_audiochannel, m_audioregister);
switch (m_audioregister)
{
case 0x00:
@ -269,8 +275,15 @@ WRITE16_MEMBER(l7a1045_sound_device::sound_data_w)
vptr->start |= (m_audiodat[m_audioregister][m_audiochannel].dat[1] & 0xffff) << (4);
vptr->start |= (m_audiodat[m_audioregister][m_audiochannel].dat[0] & 0xf000) >> (12);
//logerror("%s: channel %d start = %08x\n", tag(), m_audiochannel, vptr->start);
vptr->start &= m_rom.mask();
// if voice isn't active, clear the pos on start writes (required for DMA tests on MPC3000)
if (!(m_key & (1 << m_audiochannel)))
{
vptr->pos = 0;
}
break;
case 0x01:
// relative to start
@ -296,7 +309,7 @@ WRITE16_MEMBER(l7a1045_sound_device::sound_data_w)
vptr->end &= m_rom.mask();
}
//logerror("%s: channel %d end = %08x\n", tag(), m_audiochannel, vptr->start);
break;
case 0x07:
@ -363,3 +376,22 @@ WRITE16_MEMBER(l7a1045_sound_device::sound_status_w)
m_key |= 1 << m_audiochannel;
}
}
WRITE_LINE_MEMBER(l7a1045_sound_device::dma_hreq_cb)
{
// m_maincpu->hack_w(1);
}
READ8_MEMBER(l7a1045_sound_device::dma_r_cb)
{
// logerror("dma_ior3_cb: offset %x\n", offset);
m_voice[0].pos++;
return 0;
}
WRITE8_MEMBER(l7a1045_sound_device::dma_w_cb)
{
m_voice[0].pos++;
// logerror("dma_iow3_cb: offset %x\n", offset);
}

View File

@ -22,6 +22,10 @@ public:
DECLARE_WRITE16_MEMBER( l7a1045_sound_w );
DECLARE_READ16_MEMBER( l7a1045_sound_r );
DECLARE_READ8_MEMBER(dma_r_cb);
DECLARE_WRITE8_MEMBER(dma_w_cb);
DECLARE_WRITE_LINE_MEMBER(dma_hreq_cb);
protected:
// device-level overrides
virtual void device_start() override;

View File

@ -84,6 +84,14 @@ private:
void mpc3000_map(address_map &map);
void mpc3000_io_map(address_map &map);
DECLARE_READ16_MEMBER(dsp_0008_hack_r);
DECLARE_WRITE16_MEMBER(dsp_0008_hack_w);
DECLARE_READ8_MEMBER(dma_memr_cb);
DECLARE_WRITE8_MEMBER(lcd_w)
{
printf("%c", data);
}
};
void mpc3000_state::machine_start()
@ -101,15 +109,48 @@ void mpc3000_state::mpc3000_map(address_map &map)
map(0x500000, 0x500fff).ram(); // actually 8-bit battery-backed RAM
}
WRITE16_MEMBER(mpc3000_state::dsp_0008_hack_w)
{
// this is related to the DSP's DMA capability. The DSP
// connects to the V53's DMA3 channel on both the MPCs and HNG64.
m_maincpu->dreq3_w(data&0x1);
m_dsp->l7a1045_sound_w(space,8/2,data,mem_mask);
}
READ16_MEMBER(mpc3000_state::dsp_0008_hack_r)
{
// read in irq5
return 0;
}
void mpc3000_state::mpc3000_io_map(address_map &map)
{
map(0x0060, 0x0067).rw(m_dsp, FUNC(l7a1045_sound_device::l7a1045_sound_r), FUNC(l7a1045_sound_device::l7a1045_sound_w));
map(0x0068, 0x0069).rw(FUNC(mpc3000_state::dsp_0008_hack_r), FUNC(mpc3000_state::dsp_0008_hack_w));
map(0x00e0, 0x00e0).w(FUNC(mpc3000_state::lcd_w));
}
READ8_MEMBER(mpc3000_state::dma_memr_cb)
{
//logerror("dma_memr_cb: offset %x\n", offset);
return m_maincpu->space(AS_PROGRAM).read_byte(offset);
}
void mpc3000_state::mpc3000(machine_config &config)
{
V53A(config, m_maincpu, 16_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &mpc3000_state::mpc3000_map);
m_maincpu->set_addrmap(AS_IO, &mpc3000_state::mpc3000_io_map);
// V53A isn't devcb3 compliant yet.
//V53A(config, m_maincpu, 16_MHz_XTAL);
//m_maincpu->set_addrmap(AS_PROGRAM, &mpc3000_state::mpc3000_map);
//m_maincpu->set_addrmap(AS_IO, &mpc3000_state::mpc3000_io_map);
device_t *device = nullptr;
MCFG_DEVICE_ADD("maincpu", V53A, 16_MHz_XTAL)
MCFG_DEVICE_PROGRAM_MAP(mpc3000_map)
MCFG_DEVICE_IO_MAP(mpc3000_io_map)
MCFG_V53_DMAU_OUT_HREQ_CB(WRITELINE("maincpu", v53_base_device, hack_w))
MCFG_V53_DMAU_IN_MEMR_CB(READ8(*this, mpc3000_state, dma_memr_cb))
MCFG_V53_DMAU_IN_IOR_3_CB(WRITE8("dsp", l7a1045_sound_device, dma_r_cb))
MCFG_V53_DMAU_OUT_IOW_3_CB(WRITE8("dsp", l7a1045_sound_device, dma_w_cb))
auto &mdin(MIDI_PORT(config, "mdin"));
midiin_slot(mdin);