Previous 199869 Revisions Next

r20621 Thursday 31st January, 2013 at 01:50:53 UTC by Barry Rodewald
isa_gus:  Enabled 6850 MIDI interface with a hopefully accurate clock, and
         fixed a silly error with MIDI IRQs, and passes the MIDI transmit IRQ
         test. [Barry Rodewald]

Out of whatsnew: It still slows the drivers down a bit, but now only by about
20-25%, might be a bit more manageable now.  Also, is there any way to tell if
the 6850 triggers an IRQ on recieve or transmit, as the GUS has separate flags
for each case.  Otherwise, it can't pass the MIDI recieve IRQ test.
[src/mess/machine]isa_gus.c

trunk/src/mess/machine/isa_gus.c
r20620r20621
489489 * bit 6 - 1 if addresses are decreasing, can change when looping is enabled
490490 * bit 7 - 1 if Wavetable IRQ is pending */
491491      if(offset == 1)
492         return m_voice[m_current_voice].voice_ctrl;
492         return m_voice[m_current_voice].voice_ctrl & 0xff;
493493   case 0x81:  // Frequency Control
494494      ret = m_voice[m_current_voice].freq_ctrl;
495495      if(offset == 0)
r20620r20621
591591 * bit 5 - set to 1 to enable wavetable IRQ when end address is reached */
592592      if(offset == 1)
593593      {
594         m_voice[m_current_voice].voice_ctrl = data & 0x7f;
594         m_voice[m_current_voice].voice_ctrl = data & 0xff;
595595         m_voice[m_current_voice].rollover = false;
596596         if(data & 0x02)
597         {
598597            m_voice[m_current_voice].voice_ctrl |= 0x01;
599         }
600598      }
601599      logerror("GUS: Ch%i Voice control write %02x\n", m_current_voice,data);
602600      break;
r20620r20621
11291127      m_wave_irq_func(1);
11301128      m_voice_irq_fifo[m_voice_irq_ptr % 32] = m_irq_source;
11311129      m_voice_irq_ptr++;
1130      m_voice[voice].voice_ctrl |= 0x80;
11321131   }
11331132   if(source & IRQ_VOLUME_RAMP)
11341133   {
r20620r20621
11991198
12001199static const acia6850_interface gus_midi_interface =
12011200{
1202   GF1_CLOCK,
1203   GF1_CLOCK,  // a guess for now
1201   31250 * 16,
1202   31250 * 16,
12041203
12051204   DEVCB_NULL,
12061205   DEVCB_NULL,
r20620r20621
12091208   DEVCB_NULL,
12101209   DEVCB_NULL,
12111210
1212   DEVCB_NULL
1213   //DEVCB_LINE_MEMBER(isa16_gus_device,midi_irq)
1211   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER,isa16_gus_device,midi_irq)
12141212};
12151213
12161214static const gf1_interface gus_gf1_config =
r20620r20621
12321230   MCFG_SOUND_CONFIG(gus_gf1_config)
12331231   MCFG_SOUND_ROUTE(0,"lspeaker",0.50)
12341232   MCFG_SOUND_ROUTE(1,"rspeaker",0.50)
1235//  MCFG_ACIA6850_ADD("midi",gus_midi_interface)
1233   MCFG_ACIA6850_ADD("midi",gus_midi_interface)
12361234MACHINE_CONFIG_END
12371235
12381236static INPUT_PORTS_START( gus_joy )
r20620r20621
12751273void isa16_gus_device::device_start()
12761274{
12771275   m_gf1 = subdevice<gf1_device>("gf1");
1278   //m_midi = subdevice<acia6850_device>("midi");
1276   m_midi = subdevice<acia6850_device>("midi");
12791277   set_isa_device();
12801278   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) );
12811279   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) );
r20620r20621
13551353      break;
13561354   case 0x0f:
13571355      m_gf1->stat_w(space,offset-15,data);
1356      break;
13581357   default:
13591358      logerror("GUS: Invalid or unimplemented register write %02x of port 0x2X%01x\n",data,offset);
13601359   }
r20620r20621
13641363{
13651364   switch(offset)
13661365   {
1367//  case 0x00:
1368//      return m_midi->status_read(space,0);
1369//  case 0x01:
1370//      return m_midi->data_read(space,0);
1366   case 0x00:
1367      return m_midi->status_read(space,0);
1368   case 0x01:
1369      return m_midi->data_read(space,0);
13711370   case 0x02:
13721371   case 0x03:
13731372      return m_gf1->global_reg_select_r(space,offset-2);
r20620r20621
13891388   switch(offset)
13901389   {
13911390   case 0x00:
1392//      m_midi->control_write(space,0,data);
1391      m_midi->control_write(space,0,data);
13931392      break;
13941393   case 0x01:
1395//      m_midi->data_write(space,0,data);
1394      m_midi->data_write(space,0,data);
13961395      break;
13971396   case 0x02:
13981397   case 0x03:
r20620r20621
16741673WRITE_LINE_MEMBER( isa16_gus_device::midi_irq )
16751674{
16761675   if(state)
1677      set_irq(IRQ_MIDI_TRANSMIT);
1676      set_midi_irq(IRQ_MIDI_TRANSMIT);
16781677   else
1679      reset_irq(IRQ_MIDI_TRANSMIT);
1678      reset_midi_irq(IRQ_MIDI_TRANSMIT);
16801679}
16811680
16821681WRITE_LINE_MEMBER( isa16_gus_device::nmi_w)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team