Merge pull request #2482 from 86Box/mca_dma_fix

Actually fix the fixed dma.
This commit is contained in:
Miran Grča
2022-07-19 19:24:43 +02:00
committed by GitHub

View File

@@ -622,7 +622,7 @@ dma_ps2_read(uint16_t addr, void *priv)
else else
temp = dma_c->cc & 0xff; temp = dma_c->cc & 0xff;
dma_ps2.byte_ptr = (dma_ps2.byte_ptr + 1) & 1; dma_ps2.byte_ptr = (dma_ps2.byte_ptr + 1) & 1;
break; break;
case 6: /*Read DMA status*/ case 6: /*Read DMA status*/
if (dma_ps2.byte_ptr) { if (dma_ps2.byte_ptr) {
@@ -650,7 +650,6 @@ dma_ps2_read(uint16_t addr, void *priv)
} }
break; break;
} }
return(temp); return(temp);
} }
@@ -719,7 +718,7 @@ dma_ps2_write(uint16_t addr, uint8_t val, void *priv)
dma_c->cc = (dma_c->cc & 0xff00) | val; dma_c->cc = (dma_c->cc & 0xff00) | val;
dma_ps2.byte_ptr = (dma_ps2.byte_ptr + 1) & 1; dma_ps2.byte_ptr = (dma_ps2.byte_ptr + 1) & 1;
dma_c->cb = dma_c->cc; dma_c->cb = dma_c->cc;
break; break;
case 7: /*Mode register*/ case 7: /*Mode register*/
mode = 0; mode = 0;
@@ -727,9 +726,9 @@ dma_ps2_write(uint16_t addr, uint8_t val, void *priv)
mode |= 0x20; mode |= 0x20;
if ((val & DMA_PS2_XFER_MASK) == DMA_PS2_XFER_MEM_TO_IO) if ((val & DMA_PS2_XFER_MASK) == DMA_PS2_XFER_MEM_TO_IO)
mode |= 8; mode |= 8;
else if ((val & DMA_PS2_XFER_MASK) == DMA_PS2_XFER_IO_TO_MEM) else if ((val & DMA_PS2_XFER_MASK) == DMA_PS2_XFER_IO_TO_MEM)
mode |= 4; mode |= 4;
dma_c->mode = (dma_c->mode & ~0x2c) | mode; dma_c->mode = (dma_c->mode & ~0x2c) | 0x10 | mode;
dma_c->ps2_mode = val; dma_c->ps2_mode = val;
dma_c->size = val & DMA_PS2_SIZE16; dma_c->size = val & DMA_PS2_SIZE16;
break; break;