Added some not working interface for third AY (nw)

This commit is contained in:
angelosa 2017-08-07 03:14:38 +02:00
parent 75734b41f8
commit c5d2107331
2 changed files with 27 additions and 0 deletions

View File

@ -49,10 +49,12 @@ MACHINE_CONFIG_MEMBER( pc9801_amd98_device::device_add_mconfig )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker","rspeaker")
MCFG_SOUND_ADD("ay1", AY8910, MAIN_CLOCK_X1*2)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("OPN_PA1"))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(pc9801_amd98_device,ay3_address_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
MCFG_SOUND_ADD("ay2", AY8910, MAIN_CLOCK_X1*2)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("OPN_PA2"))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(pc9801_amd98_device,ay3_data_latch_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
MCFG_SOUND_ADD("ay3", AY8910, MAIN_CLOCK_X1*2)
@ -198,3 +200,23 @@ WRITE8_MEMBER(pc9801_amd98_device::write)
}
}
WRITE8_MEMBER(pc9801_amd98_device::ay3_address_w)
{
m_ay3_latch = data;
}
WRITE8_MEMBER(pc9801_amd98_device::ay3_data_latch_w)
{
// TODO: this actually uses a flip flop mechanism, not quite sure about how it works yet
switch(data)
{
case 0x47:
//printf("%02x addr\n",m_ay3_latch);
m_ay3->address_w(space,0,m_ay3_latch);
break;
case 0x43:
//printf("%02x data\n",m_ay3_latch);
m_ay3->data_w(space,0,m_ay3_latch);
break;
}
}

View File

@ -43,6 +43,11 @@ protected:
virtual ioport_constructor device_input_ports() const override;
private:
DECLARE_WRITE8_MEMBER(ay3_address_w);
DECLARE_WRITE8_MEMBER(ay3_data_latch_w);
uint8_t m_ay3_latch;
// required_device<cpu_device> m_maincpu;
required_device<ay8910_device> m_ay1;
required_device<ay8910_device> m_ay2;