Only bits 4 to 2 of LSR are now writable, and only in loopback mode.

This commit is contained in:
OBattler
2021-03-04 21:56:43 +01:00
parent dab4cab222
commit 87161c63dd

View File

@@ -484,14 +484,16 @@ serial_write(uint16_t addr, uint8_t val, void *p)
} }
break; break;
case 5: case 5:
dev->lsr = val; if (dev->mctrl & 0x10) {
if (dev->lsr & 0x01) dev->lsr = (dev->lsr & 0xe3) | (val & 0x1c);
dev->int_status |= SERIAL_INT_RECEIVE; if (dev->lsr & 0x01)
if (dev->lsr & 0x1e) dev->int_status |= SERIAL_INT_RECEIVE;
dev->int_status |= SERIAL_INT_LSR; if (dev->lsr & 0x1e)
if (dev->lsr & 0x20) dev->int_status |= SERIAL_INT_LSR;
dev->int_status |= SERIAL_INT_TRANSMIT; if (dev->lsr & 0x20)
serial_update_ints(dev); dev->int_status |= SERIAL_INT_TRANSMIT;
serial_update_ints(dev);
}
break; break;
case 6: case 6:
dev->msr = val; dev->msr = val;