Skip to content
Snippets Groups Projects
Commit 5c2f6392 authored by rswindell's avatar rswindell
Browse files

Bug-fix: fixes NULs in RyBBS input and fixes KnK input "correctly":

only wake-up interrupt_thread() when *asserting* an interrupt.
parent fc7059b6
No related branches found
No related tags found
No related merge requests found
......@@ -164,12 +164,13 @@ CRITICAL_SECTION interrupt_mutex;
void set_interrupt_pending(BYTE intr, BOOL assert)
{
EnterCriticalSection(&interrupt_mutex);
lprintf(LOG_DEBUG,"%sasserting interrupt %02X", assert ? "" : "de-", intr);
if(assert) {
if(uart_ier_reg&intr) /* is interrupt enabled? */
pending_interrupts |= intr; /* flag as pending */
SetEvent(interrupt_event);
} else /* de-assert */
pending_interrupts &= ~intr; /* remove as pending */
SetEvent(interrupt_event);
LeaveCriticalSection(&interrupt_mutex);
}
......@@ -184,7 +185,7 @@ void _cdecl interrupt_thread(void *arg)
if((uart_ier_reg&pending_interrupts) != 0) {
lprintf(LOG_DEBUG,"VDDSimulateInterrupt (pending: %02X) - IER: %02X"
,pending_interrupts, uart_ier_reg);
VDDSimulateInterrupt(ICA_MASTER, uart_irq, 1);
VDDSimulateInterrupt(ICA_MASTER, uart_irq, /* count: */1);
}
#if 0
/* "Real 16550s should always reassert
......@@ -343,7 +344,7 @@ VOID uart_rdport(WORD port, PBYTE data)
/* Clear data ready interrupt identification in IIR */
deassert_interrupt(UART_IER_RX_DATA);
}
return; /* early return */
break;
case UART_IER:
if(uart_lcr_reg&UART_LCR_DLAB) {
lprintf(LOG_DEBUG,"reading divisor latch MSB");
......@@ -398,7 +399,8 @@ VOID uart_rdport(WORD port, PBYTE data)
break;
}
lprintf(LOG_DEBUG, "returning 0x%02X", *data);
if(reg!=UART_BASE)
lprintf(LOG_DEBUG, "returning 0x%02X", *data);
}
/* VDD DOS Interface (mainly for FOSSIL driver in dosxtrn.exe) */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment