Finished the VIA machine.

This commit is contained in:
OBattler
2020-01-14 02:14:39 +01:00
parent 426bf8c46e
commit da82e6a5eb
20 changed files with 863 additions and 589 deletions

View File

@@ -8,15 +8,15 @@
*
* Implementation of the Intel DMA controllers.
*
* Version: @(#)dma.c 1.0.7 2019/09/28
* Version: @(#)dma.c 1.0.8 2020/01/14
*
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
* Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2008-2019 Sarah Walker.
* Copyright 2016-2019 Miran Grca.
* Copyright 2017-2019 Fred N. van Kempen.
* Copyright 2008-2020 Sarah Walker.
* Copyright 2016-2020 Miran Grca.
* Copyright 2017-2020 Fred N. van Kempen.
*/
#include <stdio.h>
#include <stdint.h>
@@ -38,6 +38,7 @@
dma_t dma[8];
uint8_t dma_e;
static uint8_t dmaregs[16];
@@ -615,6 +616,8 @@ dma_reset(void)
dma_wp = dma16_wp = 0;
dma_m = 0;
dma_e = 0xff;
for (c = 0; c < 16; c++)
dmaregs[c] = dma16regs[c] = 0;
for (c = 0; c < 8; c++) {
@@ -736,6 +739,8 @@ dma_channel_read(int channel)
return(DMA_NODATA);
}
if (!(dma_e & (1 << channel)))
return(DMA_NODATA);
if ((dma_m & (1 << channel)) && !dma_req_is_soft)
return(DMA_NODATA);
if ((dma_c->mode & 0xC) != 8)
@@ -809,6 +814,8 @@ dma_channel_write(int channel, uint16_t val)
return(DMA_NODATA);
}
if (!(dma_e & (1 << channel)))
return(DMA_NODATA);
if ((dma_m & (1 << channel)) && !dma_req_is_soft)
return(DMA_NODATA);
if ((dma_c->mode & 0xC) != 4)