General changes from the obattler_202406 branch

Co-Authored-By: Miran Grča <oubattler@gmail.com>
This commit is contained in:
Jasmine Iwanek
2024-09-09 00:43:14 -04:00
parent 9d1b9b7d02
commit d00f80d3ce
57 changed files with 493 additions and 468 deletions

View File

@@ -975,39 +975,24 @@ stpc_serial_init(UNUSED(const device_t *info))
static void
stpc_lpt_handlers(stpc_lpt_t *dev, uint8_t val)
{
uint8_t old_addr = (dev->reg1 & 0x03);
uint8_t new_addr = (val & 0x03);
const uint8_t new_addr = (val & 0x03);
switch (old_addr) {
case 0x1:
lpt3_remove();
break;
case 0x2:
lpt1_remove();
break;
case 0x3:
lpt2_remove();
break;
default:
break;
}
lpt1_remove();
switch (new_addr) {
case 0x1:
stpc_log("STPC: Remapping parallel port to LPT3\n");
lpt3_init(0x3bc);
lpt1_setup(LPT_MDA_ADDR);
break;
case 0x2:
stpc_log("STPC: Remapping parallel port to LPT1\n");
lpt1_init(0x378);
lpt1_setup(LPT1_ADDR);
break;
case 0x3:
stpc_log("STPC: Remapping parallel port to LPT2\n");
lpt2_init(0x278);
lpt1_setup(LPT2_ADDR);
break;
default:
@@ -1015,9 +1000,11 @@ stpc_lpt_handlers(stpc_lpt_t *dev, uint8_t val)
break;
}
dev->reg1 = (val & 0x08);
dev->reg1 |= new_addr;
dev->reg1 |= 0x84; /* reserved bits that default to 1; hardwired? */
if (dev != NULL) {
dev->reg1 = (val & 0x08);
dev->reg1 |= new_addr;
dev->reg1 |= 0x84; /* reserved bits that default to 1; hardwired? */
}
}
static void

View File

@@ -82,6 +82,8 @@
#include <86box/hdd.h>
#include <86box/hdc.h>
#include <86box/hdc_ide.h>
#include <86box/keyboard.h>
#include <86box/machine.h>
#include <86box/pic.h>
#include <86box/pci.h>
#include <86box/port_92.h>

View File

@@ -542,16 +542,16 @@ wd76c10_ser_par_cs_recalc(wd76c10_t *dev)
lpt1_remove();
switch ((dev->ser_par_cs >> 9) & 0x03) {
case 1:
lpt1_init(0x3bc);
lpt1_irq(7);
lpt1_setup(LPT_MDA_ADDR);
lpt1_irq(LPT1_IRQ);
break;
case 2:
lpt1_init(0x378);
lpt1_irq(7);
lpt1_setup(LPT1_ADDR);
lpt1_irq(LPT1_IRQ);
break;
case 3:
lpt1_init(0x278);
lpt1_irq(7);
lpt1_setup(LPT2_ADDR);
lpt1_irq(LPT1_IRQ);
break;
}
}