vid_mga: Busmastering works properly now

This commit is contained in:
Cacodemon345
2023-12-19 13:46:27 +06:00
parent 1f91c0e2ec
commit 3a5bbe9ad3

View File

@@ -2674,7 +2674,6 @@ run_dma(mystique_t *mystique)
if (mystique->dma.pri_state == 0 && !mystique->dma.words_expected) {
dma_bm_read(mystique->dma.primaddress & DMA_ADDR_MASK, (uint8_t *) &mystique->dma.pri_header, 4, 4);
mystique->dma.primaddress += 4;
pclog("DMA header: 0x%08X\n", mystique->dma.pri_header);
mystique->dma.words_expected = 4;
words_transferred++;
}
@@ -2685,13 +2684,12 @@ run_dma(mystique_t *mystique)
break;
}
if ((mystique->dma.pri_header & 0xff) != 0x15) {
{
uint32_t val;
uint32_t reg_addr;
dma_bm_read(mystique->dma.primaddress & DMA_ADDR_MASK, (uint8_t *) &val, 4, 4);
words_transferred++;
pclog("DMA val: 0x%08X\n", val);
reg_addr = (mystique->dma.pri_header & 0x7f) << 2;
if (mystique->dma.pri_header & 0x80)
@@ -2712,8 +2710,10 @@ run_dma(mystique_t *mystique)
mystique->dma.pri_header >>= 8;
mystique->dma.pri_state = (mystique->dma.pri_state + 1) & 3;
if (mystique->dma.state == DMA_STATE_SEC)
mystique->dma.pri_state = 0;
if (mystique->dma.state == DMA_STATE_SEC) {
mystique->dma.pri_state = 0;
mystique->dma.words_expected = 0;
}
else if ((mystique->dma.primaddress & DMA_ADDR_MASK) >= (mystique->dma.primend & DMA_ADDR_MASK)) {
mystique->endprdmasts_pending = 1;
mystique->dma.state = DMA_STATE_IDLE;