MIDI changes:

Fixed MIDI UART OUT of the ES1371 using NT 4.0's drivers and keeping compatibility with Win9x/2000.
This commit is contained in:
TC1995
2021-10-31 18:35:04 +01:00
parent fdc1fe92ed
commit 9b3b9c86b0
2 changed files with 9 additions and 18 deletions

View File

@@ -1703,24 +1703,17 @@ es1371_poll(void *p)
But if anything sets MIDI Input and Output together we'd have to take account But if anything sets MIDI Input and Output together we'd have to take account
of the MIDI Output case, and disable IRQ's and RX bits when MIDI Input is of the MIDI Output case, and disable IRQ's and RX bits when MIDI Input is
enabled as well but not in the MIDI Output portion */ enabled as well but not in the MIDI Output portion */
if (dev->uart_ctrl & UART_CTRL_TXINTEN)
dev->int_status |= INT_STATUS_UART;
else
dev->int_status &= ~INT_STATUS_UART; dev->int_status &= ~INT_STATUS_UART;
dev->uart_status |= (UART_STATUS_TXINT | UART_STATUS_TXRDY);
} else if (!(dev->uart_ctrl & UART_CTRL_RXINTEN) && ((dev->uart_ctrl & UART_CTRL_TXINTEN))) { } else if (!(dev->uart_ctrl & UART_CTRL_RXINTEN) && ((dev->uart_ctrl & UART_CTRL_TXINTEN))) {
/* Or enable the UART IRQ and the respective TX bits only when the MIDI Output is /* Or enable the UART IRQ and the respective TX bits only when the MIDI Output is
enabled */ enabled */
dev->int_status |= INT_STATUS_UART; dev->int_status |= INT_STATUS_UART;
} else {
dev->uart_status |= (UART_STATUS_TXINT | UART_STATUS_TXRDY);
} }
if (dev->uart_ctrl & UART_CTRL_RXINTEN) { audiopci_log("UART control = %02x\n", dev->uart_ctrl & (UART_CTRL_RXINTEN | UART_CTRL_TXINTEN));
if (dev->uart_ctrl & UART_CTRL_TXINTEN)
dev->uart_status |= (UART_STATUS_TXINT | UART_STATUS_TXRDY);
else
dev->uart_status &= ~(UART_STATUS_TXINT | UART_STATUS_TXRDY);
} else
dev->uart_status |= (UART_STATUS_TXINT | UART_STATUS_TXRDY);
es1371_update_irqs(dev); es1371_update_irqs(dev);
} }

View File

@@ -108,14 +108,12 @@ timer_control(opl_t *dev, int tmr, int start)
timer_on_auto(&dev->timers[tmr], (tmr == 1) ? 320.0 : 80.0); timer_on_auto(&dev->timers[tmr], (tmr == 1) ? 320.0 : 80.0);
} else { } else {
opl_log("Timer %i stopped\n", tmr); opl_log("Timer %i stopped\n", tmr);
if (!(dev->flags & FLAG_OPL3)) {
if (tmr == 1) { if (tmr == 1) {
dev->status &= ~STAT_TMR2_OVER; dev->status &= ~STAT_TMR2_OVER;
} else } else
dev->status &= ~STAT_TMR1_OVER; dev->status &= ~STAT_TMR1_OVER;
} }
} }
}
static void static void