| 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 |
| r20620 | r20621 | |
|---|---|---|
| 489 | 489 | * bit 6 - 1 if addresses are decreasing, can change when looping is enabled |
| 490 | 490 | * bit 7 - 1 if Wavetable IRQ is pending */ |
| 491 | 491 | if(offset == 1) |
| 492 | return m_voice[m_current_voice].voice_ctrl; | |
| 492 | return m_voice[m_current_voice].voice_ctrl & 0xff; | |
| 493 | 493 | case 0x81: // Frequency Control |
| 494 | 494 | ret = m_voice[m_current_voice].freq_ctrl; |
| 495 | 495 | if(offset == 0) |
| r20620 | r20621 | |
| 591 | 591 | * bit 5 - set to 1 to enable wavetable IRQ when end address is reached */ |
| 592 | 592 | if(offset == 1) |
| 593 | 593 | { |
| 594 | m_voice[m_current_voice].voice_ctrl = data & 0x | |
| 594 | m_voice[m_current_voice].voice_ctrl = data & 0xff; | |
| 595 | 595 | m_voice[m_current_voice].rollover = false; |
| 596 | 596 | if(data & 0x02) |
| 597 | { | |
| 598 | 597 | m_voice[m_current_voice].voice_ctrl |= 0x01; |
| 599 | } | |
| 600 | 598 | } |
| 601 | 599 | logerror("GUS: Ch%i Voice control write %02x\n", m_current_voice,data); |
| 602 | 600 | break; |
| r20620 | r20621 | |
| 1129 | 1127 | m_wave_irq_func(1); |
| 1130 | 1128 | m_voice_irq_fifo[m_voice_irq_ptr % 32] = m_irq_source; |
| 1131 | 1129 | m_voice_irq_ptr++; |
| 1130 | m_voice[voice].voice_ctrl |= 0x80; | |
| 1132 | 1131 | } |
| 1133 | 1132 | if(source & IRQ_VOLUME_RAMP) |
| 1134 | 1133 | { |
| r20620 | r20621 | |
| 1199 | 1198 | |
| 1200 | 1199 | static const acia6850_interface gus_midi_interface = |
| 1201 | 1200 | { |
| 1202 | GF1_CLOCK, | |
| 1203 | GF1_CLOCK, // a guess for now | |
| 1201 | 31250 * 16, | |
| 1202 | 31250 * 16, | |
| 1204 | 1203 | |
| 1205 | 1204 | DEVCB_NULL, |
| 1206 | 1205 | DEVCB_NULL, |
| r20620 | r20621 | |
| 1209 | 1208 | DEVCB_NULL, |
| 1210 | 1209 | DEVCB_NULL, |
| 1211 | 1210 | |
| 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) | |
| 1214 | 1212 | }; |
| 1215 | 1213 | |
| 1216 | 1214 | static const gf1_interface gus_gf1_config = |
| r20620 | r20621 | |
| 1232 | 1230 | MCFG_SOUND_CONFIG(gus_gf1_config) |
| 1233 | 1231 | MCFG_SOUND_ROUTE(0,"lspeaker",0.50) |
| 1234 | 1232 | MCFG_SOUND_ROUTE(1,"rspeaker",0.50) |
| 1235 | ||
| 1233 | MCFG_ACIA6850_ADD("midi",gus_midi_interface) | |
| 1236 | 1234 | MACHINE_CONFIG_END |
| 1237 | 1235 | |
| 1238 | 1236 | static INPUT_PORTS_START( gus_joy ) |
| r20620 | r20621 | |
| 1275 | 1273 | void isa16_gus_device::device_start() |
| 1276 | 1274 | { |
| 1277 | 1275 | m_gf1 = subdevice<gf1_device>("gf1"); |
| 1278 | | |
| 1276 | m_midi = subdevice<acia6850_device>("midi"); | |
| 1279 | 1277 | set_isa_device(); |
| 1280 | 1278 | 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) ); |
| 1281 | 1279 | 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) ); |
| r20620 | r20621 | |
| 1355 | 1353 | break; |
| 1356 | 1354 | case 0x0f: |
| 1357 | 1355 | m_gf1->stat_w(space,offset-15,data); |
| 1356 | break; | |
| 1358 | 1357 | default: |
| 1359 | 1358 | logerror("GUS: Invalid or unimplemented register write %02x of port 0x2X%01x\n",data,offset); |
| 1360 | 1359 | } |
| r20620 | r20621 | |
| 1364 | 1363 | { |
| 1365 | 1364 | switch(offset) |
| 1366 | 1365 | { |
| 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); | |
| 1371 | 1370 | case 0x02: |
| 1372 | 1371 | case 0x03: |
| 1373 | 1372 | return m_gf1->global_reg_select_r(space,offset-2); |
| r20620 | r20621 | |
| 1389 | 1388 | switch(offset) |
| 1390 | 1389 | { |
| 1391 | 1390 | case 0x00: |
| 1392 | ||
| 1391 | m_midi->control_write(space,0,data); | |
| 1393 | 1392 | break; |
| 1394 | 1393 | case 0x01: |
| 1395 | ||
| 1394 | m_midi->data_write(space,0,data); | |
| 1396 | 1395 | break; |
| 1397 | 1396 | case 0x02: |
| 1398 | 1397 | case 0x03: |
| r20620 | r20621 | |
| 1674 | 1673 | WRITE_LINE_MEMBER( isa16_gus_device::midi_irq ) |
| 1675 | 1674 | { |
| 1676 | 1675 | if(state) |
| 1677 | set_irq(IRQ_MIDI_TRANSMIT); | |
| 1676 | set_midi_irq(IRQ_MIDI_TRANSMIT); | |
| 1678 | 1677 | else |
| 1679 | reset_irq(IRQ_MIDI_TRANSMIT); | |
| 1678 | reset_midi_irq(IRQ_MIDI_TRANSMIT); | |
| 1680 | 1679 | } |
| 1681 | 1680 | |
| 1682 | 1681 | WRITE_LINE_MEMBER( isa16_gus_device::nmi_w) |
| Previous | 199869 Revisions | Next |