Game port overhaul
This commit is contained in:
@@ -117,14 +117,15 @@ um8669f_log(const char *fmt, ...)
|
||||
|
||||
typedef struct um8669f_t
|
||||
{
|
||||
int locked, cur_reg_108;
|
||||
void *pnp_card;
|
||||
int locked, cur_reg_108;
|
||||
void *pnp_card;
|
||||
isapnp_device_config_t *pnp_config[5];
|
||||
|
||||
uint8_t regs_108[256];
|
||||
uint8_t regs_108[256];
|
||||
|
||||
fdc_t *fdc;
|
||||
serial_t *uart[2];
|
||||
fdc_t *fdc;
|
||||
serial_t *uart[2];
|
||||
void *gameport;
|
||||
} um8669f_t;
|
||||
|
||||
|
||||
@@ -179,13 +180,13 @@ um8669f_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *pri
|
||||
break;
|
||||
|
||||
case 5:
|
||||
gameport_remap(0);
|
||||
|
||||
if (config->activate && (config->io[0].base != ISAPNP_IO_DISABLED)) {
|
||||
um8669f_log("UM8669F: Game port enabled at port %04X\n", config->io[0].base);
|
||||
gameport_remap(config->io[0].base);
|
||||
} else
|
||||
gameport_remap(dev->gameport, config->io[0].base);
|
||||
} else {
|
||||
um8669f_log("UM8669F: Game port disabled\n");
|
||||
gameport_remap(dev->gameport, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,6 +287,8 @@ um8669f_init(const device_t *info)
|
||||
dev->uart[0] = device_add_inst(&ns16550_device, 1);
|
||||
dev->uart[1] = device_add_inst(&ns16550_device, 2);
|
||||
|
||||
dev->gameport = gameport_add(&gameport_pnp_device);
|
||||
|
||||
io_sethandler(0x0108, 0x0002,
|
||||
um8669f_read, NULL, NULL, um8669f_write, NULL, NULL, dev);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user