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