Previous 199869 Revisions Next

r20235 Sunday 13th January, 2013 at 03:50:33 UTC by R. Belmont
(MESS) esq5505: add MIDI In capability to all of these drivers. [R. Belmont]
[src/mess]mess.mak
[src/mess/drivers]esq5505.c
[src/mess/machine]midiinport.c* midiinport.h*

trunk/src/mess/drivers/esq5505.c
r20234r20235
106106#include "machine/wd_fdc.h"
107107#include "machine/hd63450.h"    // compatible with MC68450, which is what these really have
108108#include "formats/esq16_dsk.h"
109
110109#include "machine/esqvfd.h"
111110#include "machine/esqpanel.h"
111#include "machine/serial.h"
112#include "machine/midiinport.h"
112113
113114#define GENERIC (0)
114115#define EPS     (1)
r20234r20235
756757   DEVCB_DEVICE_LINE_MEMBER("duart", duartn68681_device, rx_b_w)
757758};
758759
760static SLOT_INTERFACE_START(midiin_slot)
761   SLOT_INTERFACE("midiin", MIDIIN_PORT)
762SLOT_INTERFACE_END
763
764static const serial_port_interface midiin_intf =
765{
766   DEVCB_DEVICE_LINE_MEMBER("duart", duartn68681_device, rx_a_w)   // route MIDI Tx send directly to 68681 channel A Rx
767};
768
769static SLOT_INTERFACE_START(midiout_slot)
770SLOT_INTERFACE_END
771
772static const serial_port_interface midiout_intf =
773{
774   DEVCB_NULL   // midi out ports don't transmit inward
775};
776
759777static MACHINE_CONFIG_START( vfx, esq5505_state )
760778   MCFG_CPU_ADD("maincpu", M68000, XTAL_10MHz)
761779   MCFG_CPU_PROGRAM_MAP(vfx_map)
r20234r20235
764782
765783   MCFG_DUARTN68681_ADD("duart", 4000000, duart_config)
766784
785   MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL)
786   MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, NULL, NULL)
787
767788   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
768789   MCFG_SOUND_ADD("ensoniq", ES5505, XTAL_10MHz)
769790   MCFG_SOUND_CONFIG(es5505_config)
r20234r20235
801822
802823   MCFG_DUARTN68681_ADD("duart", 4000000, duart_config)
803824
825   MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL)
826   MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, NULL, NULL)
827
804828   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
805829   MCFG_SOUND_ADD("ensoniq", ES5505, XTAL_30_4761MHz / 2)
806830   MCFG_SOUND_CONFIG(es5505_config)
trunk/src/mess/mess.mak
r20234r20235
558558   $(MESS_DEVICES)/sonydriv.o  \
559559   $(MESS_DEVICES)/appldriv.o  \
560560   $(MESS_MACHINE)/dp8390.o    \
561   $(MESS_MACHINE)/midiinport.o   \
561562   $(MESS_MACHINE)/ne1000.o    \
562563   $(MESS_MACHINE)/ne2000.o    \
563564   $(MESS_MACHINE)/3c503.o     \
trunk/src/mess/machine/midiinport.c
r0r20235
1/*********************************************************************
2
3    midiinport.c
4
5    MIDI In serial port - glues the image device to the pluggable serial port
6
7*********************************************************************/
8
9#include "machine/midiinport.h"
10
11const device_type MIDIIN_PORT = &device_creator<midiin_port_device>;
12
13midiin_port_device::midiin_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
14   : device_t(mconfig, MIDIIN_PORT, "MIDI In port", tag, owner, clock),
15      device_serial_port_interface(mconfig, *this),
16      m_midiin(*this, "midiin")
17{
18}
19
20static midiin_config midiin_port_image_config =
21{
22   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, midiin_port_device, read)
23};
24
25static MACHINE_CONFIG_FRAGMENT(midiin_port_config)
26   MCFG_MIDIIN_ADD("midiin", midiin_port_image_config)
27MACHINE_CONFIG_END
28
29machine_config_constructor midiin_port_device::device_mconfig_additions() const
30{
31   return MACHINE_CONFIG_NAME(midiin_port_config);
32}
trunk/src/mess/machine/midiinport.h
r0r20235
1/*********************************************************************
2
3    midiinport.h
4
5    MIDI In serial port - glues the image device to the pluggable serial port
6
7*********************************************************************/
8
9#ifndef _MIDIINPORT_H_
10#define _MIDIINPORT_H_
11
12#include "emu.h"
13#include "machine/serial.h"
14#include "imagedev/midiin.h"
15
16class midiin_port_device :
17      public device_t,
18      public device_serial_port_interface
19{
20public:
21   midiin_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
22   virtual machine_config_constructor device_mconfig_additions() const;
23   DECLARE_WRITE_LINE_MEMBER( read ) { m_owner->out_rx(state); }
24   virtual void tx(UINT8 state) { }
25protected:
26   virtual void device_start() { m_owner = dynamic_cast<serial_port_device *>(owner()); }
27   virtual void device_reset() { }
28   virtual void device_config_complete() { m_shortname = "midiin_port"; }
29private:
30   serial_port_device *m_owner;
31   required_device<midiin_device> m_midiin;
32};
33
34extern const device_type MIDIIN_PORT;
35#endif

Previous 199869 Revisions Next


© 1997-2024 The MAME Team