trunk/src/mess/machine/isa_sblaster.c
| r20643 | r20644 | |
| 272 | 272 | m_tx_busy = false; |
| 273 | 273 | m_xmit_read = m_xmit_write = 0; |
| 274 | 274 | m_recv_read = m_recv_write = 0; |
| 275 | m_uart_xmitfull = false; |
| 275 | 276 | |
| 276 | 277 | //printf("%02x\n",data); |
| 277 | 278 | } |
| r20643 | r20644 | |
| 320 | 321 | // printf("Clear IRQ5\n"); |
| 321 | 322 | irq_w(0, IRQ_DMA8); // reading this port ACKs the card's IRQ, 8-bit dma only? |
| 322 | 323 | |
| 323 | | // in UART MIDI mode, bit 7 indicates if a character is available |
| 324 | // in either SB-MIDI mode, bit 7 indicates if a character is available |
| 324 | 325 | // to read. |
| 325 | | if (m_uart_midi) |
| 326 | if (m_uart_midi || m_onebyte_midi) |
| 326 | 327 | { |
| 327 | 328 | if (m_recv_read != m_recv_write) |
| 328 | 329 | { |
| r20643 | r20644 | |
| 338 | 339 | READ8_MEMBER(sb_device::dsp_wbuf_status_r) |
| 339 | 340 | { |
| 340 | 341 | // printf("read Wbufstat @ %x\n", offset); |
| 342 | |
| 341 | 343 | if(offset) |
| 342 | 344 | return 0xff; |
| 343 | 345 | |
| 346 | // in either SB-MIDI mode, bit 7 indicates if there's space to write. |
| 347 | // set = buffer full |
| 348 | if (m_uart_midi || m_onebyte_midi) |
| 349 | { |
| 350 | if (m_uart_xmitfull) |
| 351 | { |
| 352 | return 0x80; |
| 353 | } |
| 354 | |
| 355 | return 0x00; |
| 356 | } |
| 357 | |
| 344 | 358 | return m_dsp.wbuf_status; |
| 345 | 359 | } |
| 346 | 360 | |
| r20643 | r20644 | |
| 1207 | 1221 | m_dsp.dma_no_irq = false; |
| 1208 | 1222 | mixer_reset(); |
| 1209 | 1223 | |
| 1224 | m_onebyte_midi = false; |
| 1225 | m_uart_midi = false; |
| 1226 | m_uart_irq = false; |
| 1227 | m_mpu_midi = false; |
| 1228 | m_tx_busy = false; |
| 1229 | m_xmit_read = m_xmit_write = 0; |
| 1230 | m_recv_read = m_recv_write = 0; |
| 1231 | m_uart_xmitfull = false; |
| 1232 | |
| 1210 | 1233 | // MIDI is 31250 baud, 8-N-1 |
| 1211 | 1234 | set_rcv_rate(31250); |
| 1212 | 1235 | set_tra_rate(31250); |
| r20643 | r20644 | |
| 1546 | 1569 | |
| 1547 | 1570 | void sb_device::tra_complete() // Tx completed sending byte |
| 1548 | 1571 | { |
| 1549 | | // printf("Tx complete\n"); |
| 1572 | // printf("Tx complete\n"); |
| 1550 | 1573 | // is there more waiting to send? |
| 1551 | | if (m_xmit_read != m_xmit_write) |
| 1574 | if ((m_xmit_read != m_xmit_write) || (m_uart_xmitfull)) |
| 1552 | 1575 | { |
| 1553 | 1576 | transmit_register_setup(m_xmitring[m_xmit_read++]); |
| 1554 | 1577 | if (m_xmit_read >= MIDI_RING_SIZE) |
| 1555 | 1578 | { |
| 1556 | 1579 | m_xmit_read = 0; |
| 1557 | 1580 | } |
| 1581 | m_uart_xmitfull = false; |
| 1558 | 1582 | } |
| 1559 | 1583 | else |
| 1560 | 1584 | { |
| r20643 | r20644 | |
| 1589 | 1613 | |
| 1590 | 1614 | if (m_xmit_write == m_xmit_read) |
| 1591 | 1615 | { |
| 1592 | | printf("Overflow xmitring!\n"); |
| 1616 | m_uart_xmitfull = true; |
| 1593 | 1617 | } |
| 1594 | 1618 | } |
| 1595 | 1619 | } |
trunk/src/mess/machine/isa_sblaster.h
| r20643 | r20644 | |
| 135 | 135 | virtual void tra_callback(); // Tx send bit |
| 136 | 136 | void input_callback(UINT8 state) {} |
| 137 | 137 | |
| 138 | | static const int MIDI_RING_SIZE = 1024; |
| 138 | static const int MIDI_RING_SIZE = 2048; |
| 139 | 139 | |
| 140 | 140 | struct sb8_dsp_state m_dsp; |
| 141 | 141 | UINT8 m_dack_out; |
| 142 | 142 | void xmit_char(UINT8 data); |
| 143 | | bool m_onebyte_midi, m_uart_midi, m_uart_irq, m_mpu_midi; |
| 143 | bool m_onebyte_midi, m_uart_midi, m_uart_irq, m_mpu_midi, m_uart_xmitfull; |
| 144 | 144 | UINT8 m_recvring[MIDI_RING_SIZE]; |
| 145 | 145 | UINT8 m_xmitring[MIDI_RING_SIZE]; |
| 146 | 146 | int m_xmit_read, m_xmit_write; |