Fixed the PC87306 LPT handler.

This commit is contained in:
OBattler
2020-03-28 20:10:31 +01:00
parent dfa433194b
commit e3dc749fde

View File

@@ -96,35 +96,31 @@ lpt1_handler(pc87306_t *dev)
temp = dev->regs[0x01] & 3; temp = dev->regs[0x01] & 3;
lptba = ((uint16_t) dev->regs[0x19]) << 2; lptba = ((uint16_t) dev->regs[0x19]) << 2;
if (dev->regs[0x1b] & 0x10) { switch (temp) {
if (dev->regs[0x1b] & 0x20) { case 0:
lpt_port = 0x278;
lpt_irq = 7;
} else {
lpt_port = 0x378; lpt_port = 0x378;
lpt_irq = 5; lpt_irq = (dev->regs[0x02] & 0x08) ? 7 : 5;
} break;
} else { case 1:
switch (temp) { if (dev->regs[0x1b] & 0x40)
case 0:
lpt_port = 0x378;
lpt_irq = (dev->regs[0x02] & 0x08) ? 7 : 5;
break;
case 1:
lpt_port = lptba; lpt_port = lptba;
lpt_irq = 7; else
break; lpt_port = 0x3bc;
case 2: lpt_irq = 7;
lpt_port = 0x278; break;
lpt_irq = 5; case 2:
break; lpt_port = 0x278;
case 3: lpt_irq = 5;
lpt_port = 0x000; break;
lpt_irq = 0xff; case 3:
break; lpt_port = 0x000;
} lpt_irq = 0xff;
break;
} }
if (dev->regs[0x1b] & 0x10)
lpt_irq = (dev->regs[0x1b] & 0x20) ? 7 : 5;
if (lpt_port) if (lpt_port)
lpt1_init(lpt_port); lpt1_init(lpt_port);
@@ -212,8 +208,6 @@ pc87306_write(uint16_t port, uint8_t val, void *priv)
val = 0x4b; val = 0x4b;
valxor = val ^ dev->regs[dev->cur_reg]; valxor = val ^ dev->regs[dev->cur_reg];
dev->tries = 0; dev->tries = 0;
if ((dev->cur_reg == 0x19) && !(dev->regs[0x1B] & 0x40))
return;
if ((dev->cur_reg <= 28) && (dev->cur_reg != 8)) { if ((dev->cur_reg <= 28) && (dev->cur_reg != 8)) {
if (dev->cur_reg == 0) if (dev->cur_reg == 0)
val &= 0x5f; val &= 0x5f;