Fixed Printer and Serial configurations on the PS/1 2011/2121 models and PS/2 model 30.

This commit is contained in:
TC1995
2021-01-12 16:31:55 +01:00
parent b371e7ae5d
commit 765a328365
2 changed files with 53 additions and 49 deletions

View File

@@ -326,25 +326,31 @@ ps1_write(uint16_t port, uint8_t val, void *priv)
break; break;
case 0x0102: case 0x0102:
if (!(ps->ps1_94 & 0x80)) {
lpt1_remove(); lpt1_remove();
if (val & 0x04) serial_remove(ps->uart);
if (val & 0x04) {
if (val & 0x08)
serial_setup(ps->uart, SERIAL1_ADDR, SERIAL1_IRQ); serial_setup(ps->uart, SERIAL1_ADDR, SERIAL1_IRQ);
else else
serial_remove(ps->uart); serial_setup(ps->uart, SERIAL2_ADDR, SERIAL2_IRQ);
}
if (val & 0x10) { if (val & 0x10) {
switch ((val >> 5) & 3) { switch ((val >> 5) & 3)
{
case 0: case 0:
lpt1_init(0x03bc); lpt1_init(0x3bc);
break; break;
case 1: case 1:
lpt1_init(0x0378); lpt1_init(0x378);
break; break;
case 2: case 2:
lpt1_init(0x0278); lpt1_init(0x278);
break; break;
} }
} }
ps->ps1_102 = val; ps->ps1_102 = val;
}
break; break;
case 0x0103: case 0x0103:
@@ -469,17 +475,16 @@ ps1_setup(int model)
ps1_hdc_inform(priv, &ps->ps1_91); ps1_hdc_inform(priv, &ps->ps1_91);
} }
}
if (model == 2121) { /* Enable the PS/1 VGA controller. */
device_add(&ps1vga_device);
} else if (model == 2121) {
io_sethandler(0x00e0, 2, io_sethandler(0x00e0, 2,
ps1_read, NULL, NULL, ps1_write, NULL, NULL, ps); ps1_read, NULL, NULL, ps1_write, NULL, NULL, ps);
#if 0
rom_init(&ps->high_rom, rom_init(&ps->high_rom,
L"roms/machines/ibmps1_2121/fc0000.bin", L"roms/machines/ibmps1_2121/fc0000.bin",
0xfc0000, 0x20000, 0x1ffff, 0, MEM_MAPPING_EXTERNAL); 0xfc0000, 0x20000, 0x1ffff, 0, MEM_MAPPING_EXTERNAL);
#endif
/* Initialize the video controller. */ /* Initialize the video controller. */
if (gfxcard == VID_INTERNAL) if (gfxcard == VID_INTERNAL)
@@ -491,12 +496,6 @@ ps1_setup(int model)
device_add(&snd_device); device_add(&snd_device);
} }
/* Enable the PS/1 VGA controller. */
if (model == 2011)
device_add(&ps1vga_device);
else if (model == 2021)
device_add(&ibm_ps1_2121_device);
} }
static void static void

View File

@@ -84,13 +84,16 @@ static void ps2_write(uint16_t port, uint8_t val, void *p)
ps2_94 = val; ps2_94 = val;
break; break;
case 0x102: case 0x102:
if (!(ps2_94 & 0x80)) {
lpt1_remove(); lpt1_remove();
if (val & 0x04) serial_remove(ps2_uart);
if (val & 0x04) {
if (val & 0x08)
serial_setup(ps2_uart, SERIAL1_ADDR, SERIAL1_IRQ); serial_setup(ps2_uart, SERIAL1_ADDR, SERIAL1_IRQ);
else else
serial_remove(ps2_uart); serial_setup(ps2_uart, SERIAL2_ADDR, SERIAL2_IRQ);
if (val & 0x10) }
{ if (val & 0x10) {
switch ((val >> 5) & 3) switch ((val >> 5) & 3)
{ {
case 0: case 0:
@@ -105,7 +108,9 @@ static void ps2_write(uint16_t port, uint8_t val, void *p)
} }
} }
ps2_102 = val; ps2_102 = val;
}
break; break;
case 0x103: case 0x103:
ps2_103 = val; ps2_103 = val;
break; break;