Reworked serial and LPT set up - they can now bet set to any I/O base address (though that capability is not used by anything yet);

The CD-ROM IOCTL direct pass through code now does sanity check on the requested data size before passing the command - fixes crashes with some DMA-only host DVD drives;
The network poller is now in its own thread;
The hack is back in the emulation of the National Semiconductors PC87306 Super I/O Chip - it's the only way right now to have serial working on that board;
Fixed a part of the code that was still using NukedOPL even when OPL 3 was set to DOSBox OPL;
Applied all mainline PCem commits.
This commit is contained in:
OBattler
2017-02-07 02:19:48 +01:00
parent 22c3a74e3b
commit c8c49ac216
14 changed files with 1990 additions and 1883 deletions

View File

@@ -65,31 +65,33 @@ uint8_t lpt2_read(uint16_t port, void *priv)
return 0xff;
}
uint16_t lpt_addr[2] = { 0x378, 0x278 };
void lpt_init()
{
io_sethandler(0x0378, 0x0003, lpt1_read, NULL, NULL, lpt1_write, NULL, NULL, NULL);
io_sethandler(0x0278, 0x0003, lpt2_read, NULL, NULL, lpt2_write, NULL, NULL, NULL);
lpt_addr[0] = 0x378;
lpt_addr[1] = 0x378;
}
void lpt1_init(uint16_t port)
{
io_sethandler(port, 0x0003, lpt1_read, NULL, NULL, lpt1_write, NULL, NULL, NULL);
lpt_addr[0] = port;
}
void lpt1_remove()
{
io_removehandler(0x0278, 0x0003, lpt1_read, NULL, NULL, lpt1_write, NULL, NULL, NULL);
io_removehandler(0x0378, 0x0003, lpt1_read, NULL, NULL, lpt1_write, NULL, NULL, NULL);
io_removehandler(0x03bc, 0x0003, lpt1_read, NULL, NULL, lpt1_write, NULL, NULL, NULL);
io_removehandler(lpt_addr[0], 0x0003, lpt1_read, NULL, NULL, lpt1_write, NULL, NULL, NULL);
}
void lpt2_init(uint16_t port)
{
io_sethandler(port, 0x0003, lpt2_read, NULL, NULL, lpt2_write, NULL, NULL, NULL);
lpt_addr[1] = port;
}
void lpt2_remove()
{
io_removehandler(0x0278, 0x0003, lpt2_read, NULL, NULL, lpt2_write, NULL, NULL, NULL);
io_removehandler(0x0378, 0x0003, lpt2_read, NULL, NULL, lpt2_write, NULL, NULL, NULL);
io_removehandler(0x03bc, 0x0003, lpt2_read, NULL, NULL, lpt2_write, NULL, NULL, NULL);
io_removehandler(lpt_addr[1], 0x0003, lpt2_read, NULL, NULL, lpt2_write, NULL, NULL, NULL);
}
void lpt2_remove_ams()