Added PS/2 Model 55SX emulation.

This commit is contained in:
SarahW 2017-04-09 14:52:02 +01:00
commit 6757fbfb94
9 changed files with 431 additions and 100 deletions

View file

@ -129,6 +129,7 @@ static uint8_t dma_ps2_read(uint16_t addr, void *priv)
switch (dma.xfr_command)
{
case 2: /*Address*/
case 3:
switch (dma.byte_ptr)
{
case 0:
@ -146,6 +147,7 @@ static uint8_t dma_ps2_read(uint16_t addr, void *priv)
}
break;
case 4: /*Count*/
case 5:
if (dma.byte_ptr)
temp = (dma.xfr_channel & 4) ? (dma16.cc[dma.xfr_channel & 3] >> 8) : (dma.cc[dma.xfr_channel] >> 8);
else
@ -155,6 +157,9 @@ static uint8_t dma_ps2_read(uint16_t addr, void *priv)
case 7: /*Mode*/
temp = (dma.xfr_channel & 4) ? dma16.mode[dma.xfr_channel & 3] : dma.mode[dma.xfr_channel];
break;
case 8: /*Arbitration Level*/
temp = (dma.xfr_channel & 4) ? dma16.arb_level[dma.xfr_channel & 3] : dma.arb_level[dma.xfr_channel];
break;
default:
fatal("Bad XFR Read command %i channel %i\n", dma.xfr_command, dma.xfr_channel);
@ -261,6 +266,13 @@ static void dma_ps2_write(uint16_t addr, uint8_t val, void *priv)
dma.mode[dma.xfr_channel] = mode;
break;
case 8: /*Arbitration Level*/
if (dma.xfr_channel & 4)
dma16.arb_level[dma.xfr_channel & 3] = val;
else
dma.arb_level[dma.xfr_channel] = val;
break;
default:
fatal("Bad XFR command %i channel %i val %02x\n", dma.xfr_command, dma.xfr_channel, val);
}