Actually fix the fixed dma.

This commit is contained in:
TC1995
2022-07-19 19:21:15 +02:00
parent d3350fa06c
commit 2df92dc7f3

View File

@@ -592,7 +592,7 @@ static uint8_t
dma_ps2_read(uint16_t addr, void *priv) dma_ps2_read(uint16_t addr, void *priv)
{ {
dma_t *dma_c = &dma[dma_ps2.xfr_channel]; dma_t *dma_c = &dma[dma_ps2.xfr_channel];
uint8_t temp = 0xff; uint8_t temp = 0;
switch (addr) { switch (addr) {
case 0x1a: case 0x1a:
@@ -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;