diff --git a/src/sbbs3/sbbsexec.c b/src/sbbs3/sbbsexec.c index 553b48d382ad0f703e2dfdf77872eb359905b9a9..aba9923b69531584d89a9968f94618f2dd102212 100644 --- a/src/sbbs3/sbbsexec.c +++ b/src/sbbs3/sbbsexec.c @@ -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) */