Implement PPI switch read correctly for IBM PC.

This commit is contained in:
TomW 2015-10-23 20:40:28 +01:00
commit 774115c6ca

View file

@ -98,14 +98,14 @@ uint8_t keyboard_xt_read(uint16_t port, void *priv)
switch (port) switch (port)
{ {
case 0x60: case 0x60:
if (keyboard_xt.pb & 0x80) if ((romset == ROM_IBMPC) && (keyboard_xt.pb & 0x80))
{ {
if (VGA) if (VGA || gfxcard == GFX_EGA)
temp = 0x4D; temp = 0x4D;
else if (MDA) else if (MDA)
temp = 0x7D; temp = 0x7D;
else else
temp = 0x6D; temp = 0x6D;
} }
else else
{ {
@ -128,17 +128,27 @@ uint8_t keyboard_xt_read(uint16_t port, void *priv)
break; break;
case 0x62: case 0x62:
if (keyboard_xt.pb & 0x08) if (romset == ROM_IBMPC)
{ {
if (VGA) if (keyboard_xt.pb & 0x04)
temp = 4; temp = 0x02;
else if (MDA)
temp = 7;
else else
temp = 6; temp = 0x01;
} }
else else
temp = 0xD; {
if (keyboard_xt.pb & 0x08)
{
if (VGA || gfxcard == GFX_EGA)
temp = 4;
else if (MDA)
temp = 7;
else
temp = 6;
}
else
temp = 0xD;
}
temp |= (ppispeakon ? 0x20 : 0); temp |= (ppispeakon ? 0x20 : 0);
break; break;