Removed the last accidental left-over and the legacy #define's in lpt.h.

This commit is contained in:
OBattler
2025-08-03 10:53:18 +02:00
parent 9a8e0acace
commit 9842ef6346
5 changed files with 41 additions and 47 deletions

View File

@@ -80,10 +80,12 @@ typedef struct stpc_serial_t {
} stpc_serial_t;
typedef struct stpc_lpt_t {
uint8_t unlocked;
uint8_t offset;
uint8_t reg1;
uint8_t reg4;
uint8_t unlocked;
uint8_t offset;
uint8_t reg1;
uint8_t reg4;
lpt_t *lpt;
} stpc_lpt_t;
#ifdef ENABLE_STPC_LOG
@@ -977,22 +979,22 @@ stpc_lpt_handlers(stpc_lpt_t *dev, uint8_t val)
{
const uint8_t new_addr = (val & 0x03);
lpt1_remove();
lpt_port_remove(dev->lpt);
switch (new_addr) {
case 0x1:
stpc_log("STPC: Remapping parallel port to LPT3\n");
lpt1_setup(LPT_MDA_ADDR);
lpt_port_setup(dev->lpt, LPT_MDA_ADDR);
break;
case 0x2:
stpc_log("STPC: Remapping parallel port to LPT1\n");
lpt1_setup(LPT1_ADDR);
lpt_port_setup(dev->lpt, LPT1_ADDR);
break;
case 0x3:
stpc_log("STPC: Remapping parallel port to LPT2\n");
lpt1_setup(LPT2_ADDR);
lpt_port_setup(dev->lpt, LPT2_ADDR);
break;
default:
@@ -1063,6 +1065,8 @@ stpc_lpt_init(UNUSED(const device_t *info))
stpc_lpt_t *dev = (stpc_lpt_t *) calloc(1, sizeof(stpc_lpt_t));
dev->lpt = device_add_inst(&lpt_port_device, 1);
stpc_lpt_reset(dev);
io_sethandler(0x3f0, 2,

View File

@@ -113,9 +113,9 @@ typedef struct
mem_mapping_t ram_mapping;
nvr_t *nvr;
fdc_t *fdc;
serial_t *uart[2];
fdc_t *fdc;
serial_t *uart[2];
lpt_t *lpt;
} wd76c10_t;
static uint32_t bank_sizes[4] = { 0x00020000, /* 64 Kbit X 16 = 1024 Kbit = 128 kB, 8x 8 */
@@ -911,19 +911,19 @@ wd76c10_ser_par_cs_recalc(wd76c10_t *dev)
}
/* LPT */
lpt1_remove();
lpt_port_remove(dev->lpt);
switch ((dev->ser_par_cs >> 9) & 0x03) {
case 1:
lpt1_setup(LPT_MDA_ADDR);
lpt1_irq(LPT1_IRQ);
lpt_port_setup(dev->lpt, LPT_MDA_ADDR);
lpt_port_irq(dev->lpt, LPT1_IRQ);
break;
case 2:
lpt1_setup(LPT1_ADDR);
lpt1_irq(LPT1_IRQ);
lpt_port_setup(dev->lpt, LPT1_ADDR);
lpt_port_irq(dev->lpt, LPT1_IRQ);
break;
case 3:
lpt1_setup(LPT2_ADDR);
lpt1_irq(LPT1_IRQ);
lpt_port_setup(dev->lpt, LPT2_ADDR);
lpt_port_irq(dev->lpt, LPT1_IRQ);
break;
}
}
@@ -1173,8 +1173,8 @@ wd76c10_inw(uint16_t port, void *priv)
case 0xd072:
ret = (serial_read(0x0002, dev->uart[0]) & 0xc0) << 8;
ret |= (serial_read(0x0002, dev->uart[1]) & 0xc0) << 6;
ret |= (lpt_read_port(0, 0x0002) & 0x0f) << 8;
ret |= lpt_read_port(0, 0x0000);
ret |= (lpt_read_port(dev->lpt, 0x0002) & 0x0f) << 8;
ret |= lpt_read_port(dev->lpt, 0x0000);
break;
case 0xe072:
@@ -1188,7 +1188,7 @@ wd76c10_inw(uint16_t port, void *priv)
break;
case 0xfc72:
ret = ((lpt_read_status(0) & 0x20) >> 2);
ret = ((lpt_read_status(dev->lpt) & 0x20) >> 2);
ret |= (((uint16_t) dma_m) << 4);
ret |= dev->toggle;
dev->toggle ^= 0x8000;
@@ -1303,6 +1303,7 @@ wd76c10_init(UNUSED(const device_t *info))
dev->nvr = device_add(&amstrad_megapc_nvr_device);
dev->uart[0] = device_add_inst(&ns16450_device, 1);
dev->uart[1] = device_add_inst(&ns16450_device, 2);
dev->lpt = device_add_inst(&lpt_port_device, 1);
dev->fdc = device_add(&fdc_at_device);
device_add(&ide_isa_device);