Merge pull request #1777 from 86Box/tc1995

MIDI changes:
This commit is contained in:
Miran Grča
2021-10-31 18:49:05 +01:00
committed by GitHub
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
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 */
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))) {
/* Or enable the UART IRQ and the respective TX bits only when the MIDI Output is
enabled */
dev->int_status |= INT_STATUS_UART;
} else {
dev->uart_status |= (UART_STATUS_TXINT | UART_STATUS_TXRDY);
}
if (dev->uart_ctrl & UART_CTRL_RXINTEN) {
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);
audiopci_log("UART control = %02x\n", dev->uart_ctrl & (UART_CTRL_RXINTEN | UART_CTRL_TXINTEN));
es1371_update_irqs(dev);
}

View File

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