diff --git a/src/mame/drivers/stellafr.cpp b/src/mame/drivers/stellafr.cpp index 32c9f704c69..945bf87c5cc 100644 --- a/src/mame/drivers/stellafr.cpp +++ b/src/mame/drivers/stellafr.cpp @@ -13,36 +13,93 @@ Possibly related to ADP hardware? #include "emu.h" #include "cpu/m68000/m68000.h" +#include "machine/mc68681.h" +#include "sound/ay8910.h" +#include "speaker.h" class stellafr_state : public driver_device { public: stellafr_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") + m_maincpu(*this, "maincpu"), + m_duart(*this, "duart") { } + IRQ_CALLBACK_MEMBER(irq_ack); + DECLARE_WRITE8_MEMBER(write_8000c1); + DECLARE_READ8_MEMBER(read_800101); + DECLARE_WRITE8_MEMBER(write_800101); + DECLARE_WRITE8_MEMBER(duart_output_w); + DECLARE_WRITE8_MEMBER(ay8910_portb_w); + protected: // devices required_device m_maincpu; + required_device m_duart; }; +IRQ_CALLBACK_MEMBER(stellafr_state::irq_ack) +{ + return m_duart->get_irq_vector(); +} + +WRITE8_MEMBER(stellafr_state::write_8000c1) +{ +} + +READ8_MEMBER(stellafr_state::read_800101) +{ + return 0xff; +} + +WRITE8_MEMBER(stellafr_state::write_800101) +{ +} + +WRITE8_MEMBER(stellafr_state::duart_output_w) +{ +} + +WRITE8_MEMBER(stellafr_state::ay8910_portb_w) +{ +} + + static ADDRESS_MAP_START( stellafr_map, AS_PROGRAM, 16, stellafr_state ) AM_RANGE(0x000000, 0x01ffff) AM_ROM + AM_RANGE(0x8000c0, 0x8000c1) AM_WRITE8(write_8000c1, 0x00ff) + AM_RANGE(0x800100, 0x800101) AM_READWRITE8(read_800101, write_800101, 0x00ff) + AM_RANGE(0x800140, 0x800141) AM_DEVREADWRITE8("aysnd", ay8910_device, data_r, address_w, 0x00ff) + AM_RANGE(0x800142, 0x800143) AM_DEVWRITE8("aysnd", ay8910_device, data_w, 0x00ff) + AM_RANGE(0x800180, 0x80019f) AM_DEVREADWRITE8("duart", mc68681_device, read, write, 0x00ff) AM_RANGE(0xff0000, 0xffffff) AM_RAM ADDRESS_MAP_END static INPUT_PORTS_START( stellafr ) + PORT_START("INPUTS") + PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNKNOWN) INPUT_PORTS_END static MACHINE_CONFIG_START( stellafr ) MCFG_CPU_ADD("maincpu", M68000, 10000000 ) //? MCFG_CPU_PROGRAM_MAP(stellafr_map) + MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(stellafr_state, irq_ack) + + MCFG_DEVICE_ADD("duart", MC68681, 3686400) + MCFG_MC68681_IRQ_CALLBACK(INPUTLINE("maincpu", M68K_IRQ_2)) // ? + MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(stellafr_state, duart_output_w)) + + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("aysnd", AY8910, 1000000) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + MCFG_AY8910_PORT_A_READ_CB(IOPORT("INPUTS")) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(stellafr_state, ay8910_portb_w)) MACHINE_CONFIG_END