(MESS) esq5505: add MIDI In capability to all of these drivers. [R. Belmont]

This commit is contained in:
R. Belmont 2013-01-13 03:50:33 +00:00
parent f6c44c6e9b
commit 098c5a9064
5 changed files with 95 additions and 1 deletions

2
.gitattributes vendored
View file

@ -7208,6 +7208,8 @@ src/mess/machine/mface2.h svneol=native#text/plain
src/mess/machine/micropolis.c svneol=native#text/plain
src/mess/machine/micropolis.h svneol=native#text/plain
src/mess/machine/microtan.c svneol=native#text/plain
src/mess/machine/midiinport.c svneol=native#text/plain
src/mess/machine/midiinport.h svneol=native#text/plain
src/mess/machine/mikro80.c svneol=native#text/plain
src/mess/machine/mm58274c.c svneol=native#text/plain
src/mess/machine/mm58274c.h svneol=native#text/plain

View file

@ -106,9 +106,10 @@
#include "machine/wd_fdc.h"
#include "machine/hd63450.h" // compatible with MC68450, which is what these really have
#include "formats/esq16_dsk.h"
#include "machine/esqvfd.h"
#include "machine/esqpanel.h"
#include "machine/serial.h"
#include "machine/midiinport.h"
#define GENERIC (0)
#define EPS (1)
@ -756,6 +757,23 @@ static const esqpanel_interface esqpanel_config =
DEVCB_DEVICE_LINE_MEMBER("duart", duartn68681_device, rx_b_w)
};
static SLOT_INTERFACE_START(midiin_slot)
SLOT_INTERFACE("midiin", MIDIIN_PORT)
SLOT_INTERFACE_END
static const serial_port_interface midiin_intf =
{
DEVCB_DEVICE_LINE_MEMBER("duart", duartn68681_device, rx_a_w) // route MIDI Tx send directly to 68681 channel A Rx
};
static SLOT_INTERFACE_START(midiout_slot)
SLOT_INTERFACE_END
static const serial_port_interface midiout_intf =
{
DEVCB_NULL // midi out ports don't transmit inward
};
static MACHINE_CONFIG_START( vfx, esq5505_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_10MHz)
MCFG_CPU_PROGRAM_MAP(vfx_map)
@ -764,6 +782,9 @@ static MACHINE_CONFIG_START( vfx, esq5505_state )
MCFG_DUARTN68681_ADD("duart", 4000000, duart_config)
MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL)
MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, NULL, NULL)
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_SOUND_ADD("ensoniq", ES5505, XTAL_10MHz)
MCFG_SOUND_CONFIG(es5505_config)
@ -801,6 +822,9 @@ static MACHINE_CONFIG_START(vfx32, esq5505_state)
MCFG_DUARTN68681_ADD("duart", 4000000, duart_config)
MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL)
MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, NULL, NULL)
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_SOUND_ADD("ensoniq", ES5505, XTAL_30_4761MHz / 2)
MCFG_SOUND_CONFIG(es5505_config)

View file

@ -0,0 +1,32 @@
/*********************************************************************
midiinport.c
MIDI In serial port - glues the image device to the pluggable serial port
*********************************************************************/
#include "machine/midiinport.h"
const device_type MIDIIN_PORT = &device_creator<midiin_port_device>;
midiin_port_device::midiin_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, MIDIIN_PORT, "MIDI In port", tag, owner, clock),
device_serial_port_interface(mconfig, *this),
m_midiin(*this, "midiin")
{
}
static midiin_config midiin_port_image_config =
{
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, midiin_port_device, read)
};
static MACHINE_CONFIG_FRAGMENT(midiin_port_config)
MCFG_MIDIIN_ADD("midiin", midiin_port_image_config)
MACHINE_CONFIG_END
machine_config_constructor midiin_port_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME(midiin_port_config);
}

View file

@ -0,0 +1,35 @@
/*********************************************************************
midiinport.h
MIDI In serial port - glues the image device to the pluggable serial port
*********************************************************************/
#ifndef _MIDIINPORT_H_
#define _MIDIINPORT_H_
#include "emu.h"
#include "machine/serial.h"
#include "imagedev/midiin.h"
class midiin_port_device :
public device_t,
public device_serial_port_interface
{
public:
midiin_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual machine_config_constructor device_mconfig_additions() const;
DECLARE_WRITE_LINE_MEMBER( read ) { m_owner->out_rx(state); }
virtual void tx(UINT8 state) { }
protected:
virtual void device_start() { m_owner = dynamic_cast<serial_port_device *>(owner()); }
virtual void device_reset() { }
virtual void device_config_complete() { m_shortname = "midiin_port"; }
private:
serial_port_device *m_owner;
required_device<midiin_device> m_midiin;
};
extern const device_type MIDIIN_PORT;
#endif

View file

@ -558,6 +558,7 @@ $(MESSOBJ)/shared.a: \
$(MESS_DEVICES)/sonydriv.o \
$(MESS_DEVICES)/appldriv.o \
$(MESS_MACHINE)/dp8390.o \
$(MESS_MACHINE)/midiinport.o \
$(MESS_MACHINE)/ne1000.o \
$(MESS_MACHINE)/ne2000.o \
$(MESS_MACHINE)/3c503.o \