Previous 199869 Revisions Next

r20649 Friday 1st February, 2013 at 12:21:53 UTC by Barry Rodewald
isa_gus:  Added MIDI In and Out.
6850acia: Added accessor function for status (no whatsnew)

MIDI Out seems to work fine with Win 3.1 MIDI Mapper and Media Player.
To use with these, open MIDI Mapper, and edit the General MIDI setup, and
change each channel from "Ultrasound MIDI Synth" to "Ultrasound MIDI Output
Port"

MIDI In is untested, and the MIDI Receive IRQ test still fails.
[src/emu/machine]6850acia.h
[src/mess/machine]isa_gus.c isa_gus.h

trunk/src/emu/machine/6850acia.h
r20648r20649
9191
9292   void receive_data(UINT8 data);
9393
94   UINT8 get_status() { return m_status; }  // returns current status without mangling it
95
9496protected:
9597   // device-level overrides
9698   virtual void device_start();
trunk/src/mess/machine/isa_gus.c
r20648r20649
1010#include "sound/speaker.h"
1111#include "machine/6850acia.h"
1212
13
1314//**************************************************************************
1415//  GLOBAL VARIABLES
1516//**************************************************************************
r20648r20649
11991200static const acia6850_interface gus_midi_interface =
12001201{
12011202   31250 * 16,
1202   31250 * 16,
1203   0,
12031204
1204   DEVCB_NULL,
1205   DEVCB_NULL,
1205   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa16_gus_device, rx_in),   // rx in
1206   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa16_gus_device, tx_out),   // tx out
12061207
12071208   DEVCB_NULL,
12081209   DEVCB_NULL,
r20648r20649
12111212   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER,isa16_gus_device,midi_irq)
12121213};
12131214
1215static SLOT_INTERFACE_START(midiin_slot)
1216   SLOT_INTERFACE("midiin", MIDIIN_PORT)
1217SLOT_INTERFACE_END
1218
1219static const serial_port_interface midiin_intf =
1220{
1221   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa16_gus_device, midi_rx_w)
1222};
1223
1224static SLOT_INTERFACE_START(midiout_slot)
1225   SLOT_INTERFACE("midiout", MIDIOUT_PORT)
1226SLOT_INTERFACE_END
1227
1228static const serial_port_interface midiout_intf =
1229{
1230   DEVCB_NULL   // midi out ports don't transmit inward
1231};
1232
12141233static const gf1_interface gus_gf1_config =
12151234{
12161235   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER,isa16_gus_device,wavetable_irq),
r20648r20649
12311250   MCFG_SOUND_ROUTE(0,"lspeaker",0.50)
12321251   MCFG_SOUND_ROUTE(1,"rspeaker",0.50)
12331252   MCFG_ACIA6850_ADD("midi",gus_midi_interface)
1253   MCFG_SERIAL_PORT_ADD("mdin", midiin_intf, midiin_slot, "midiin", NULL)
1254   MCFG_SERIAL_PORT_ADD("mdout", midiout_intf, midiout_slot, "midiout", NULL)
12341255MACHINE_CONFIG_END
12351256
12361257static INPUT_PORTS_START( gus_joy )
r20648r20649
12741295{
12751296   m_gf1 = subdevice<gf1_device>("gf1");
12761297   m_midi = subdevice<acia6850_device>("midi");
1298   m_mdout = subdevice<serial_port_device>("mdout");
12771299   set_isa_device();
12781300   m_isa->install_device(0x0200, 0x0201, 0, 0, read8_delegate(FUNC(isa16_gus_device::joy_r),this), write8_delegate(FUNC(isa16_gus_device::joy_w),this) );
12791301   m_isa->install_device(0x0220, 0x022f, 0, 0, read8_delegate(FUNC(isa16_gus_device::board_r),this), write8_delegate(FUNC(isa16_gus_device::board_w),this) );
r20648r20649
16721694
16731695WRITE_LINE_MEMBER( isa16_gus_device::midi_irq )
16741696{
1675   if(state)
1676      set_midi_irq(IRQ_MIDI_TRANSMIT);
1697   UINT8 irq_type;
1698   UINT8 st = m_midi->get_status();
1699
1700   logerror("GUS: MIDI IRQ: state: %i Status: %02x\n",state,st);
1701
1702   if(state == ASSERT_LINE)
1703   {
1704      if(st & 0x01) // receive
1705         irq_type = IRQ_MIDI_RECEIVE;
1706      else
1707         if(st & 0x02) // transmit
1708            irq_type = IRQ_MIDI_TRANSMIT;
1709         else
1710         {
1711            logerror("GUS: MIDI IRQ unknown: %02x\n",st);
1712            return;  // Should never reach here...
1713         }
1714      set_midi_irq(irq_type);
1715   }
16771716   else
1678      reset_midi_irq(IRQ_MIDI_TRANSMIT);
1717      reset_midi_irq(IRQ_MIDI_TRANSMIT | IRQ_MIDI_RECEIVE);
16791718}
16801719
1720WRITE_LINE_MEMBER( isa16_gus_device::midi_rx_w )
1721{
1722   m_rx_state = state;
1723   for (int i = 0; i < 16; i++)   // divider is set to 16
1724   {
1725      m_midi->rx_clock_in();
1726   }
1727}
1728
1729READ_LINE_MEMBER( isa16_gus_device::rx_in )
1730{
1731   return m_rx_state;
1732}
1733
1734WRITE_LINE_MEMBER( isa16_gus_device::tx_out )
1735{
1736   m_mdout->tx(state);
1737}
1738
16811739WRITE_LINE_MEMBER( isa16_gus_device::nmi_w)
16821740{
16831741   m_irq_status |= IRQ_SB;
trunk/src/mess/machine/isa_gus.h
r20648r20649
4343#include "emu.h"
4444#include "machine/isa.h"
4545#include "machine/6850acia.h"
46#include "machine/serial.h"
47#include "machine/midiinport.h"
48#include "machine/midioutport.h"
4649
4750//**************************************************************************
4851//  TYPE DEFINITIONS
r20648r20649
251254      DECLARE_WRITE_LINE_MEMBER(drq1_w);
252255      DECLARE_WRITE_LINE_MEMBER(drq2_w);
253256      DECLARE_WRITE_LINE_MEMBER(nmi_w);
257      DECLARE_WRITE_LINE_MEMBER( midi_rx_w );
258      DECLARE_READ_LINE_MEMBER( rx_in );
259      DECLARE_WRITE_LINE_MEMBER( tx_out );
254260
255261      // DMA overrides
256262      virtual UINT8 dack_r(int line);
r20648r20649
269275private:
270276      gf1_device* m_gf1;
271277      acia6850_device* m_midi;
278      serial_port_device* m_mdout;
272279
273280      UINT8 m_irq_status;
274281      attotime m_joy_time;
282      int m_rx_state;
275283};
276284
277285// device type definition

Previous 199869 Revisions Next


© 1997-2024 The MAME Team