From 685dfbb24ed82f985f4dda43307a7a05fb3ae640 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 15 Jun 2020 22:40:45 +0200 Subject: [PATCH] Fixed 16-bit DMA reads, fixes error 10482 on MCA IBM PS/2's with IBM ESDI controller. --- src/dma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dma.c b/src/dma.c index 5a76260bf..bbfdf2118 100644 --- a/src/dma.c +++ b/src/dma.c @@ -1243,13 +1243,13 @@ _dma_read(uint32_t addr, dma_t *dma_c) static uint16_t _dma_readw(uint32_t addr, dma_t *dma_c) { - uint8_t temp; + uint16_t temp; if (dma_advanced) { if (dma_c->sg_status & 1) - dma_c->sg_status = (dma_c->sg_status & 0x0f) | (dma_sg(&temp, 2, 1, dma_c) << 4); + dma_c->sg_status = (dma_c->sg_status & 0x0f) | (dma_sg((uint8_t *) &temp, 2, 1, dma_c) << 4); else - dma_bm_read(addr, &temp, 2, dma_transfer_size(dma_c)); + dma_bm_read(addr, (uint8_t *) &temp, 2, dma_transfer_size(dma_c)); } else temp = _dma_read(addr, dma_c) | (_dma_read(addr + 1, dma_c) << 8);