diff vdp.c @ 135:a81c548cf353

Fix 68K->VDP DMA
author Mike Pavone <pavone@retrodev.com>
date Sun, 30 Dec 2012 11:54:25 -0800
parents 8fc8e46be691
children 0e7e1ccc0a81
line wrap: on
line diff
--- a/vdp.c	Sun Dec 30 09:55:18 2012 -0800
+++ b/vdp.c	Sun Dec 30 11:54:25 2012 -0800
@@ -225,7 +225,6 @@
 					context->vdpmem[context->address ^ 1] = context->dma_val >> 8;
 					context->flags &= ~FLAG_DMA_PROG;
 				} else {
-					context->dma_val = read_dma_value((context->regs[REG_DMASRC_H] << 16) | (context->regs[REG_DMASRC_M] << 8) | context->regs[REG_DMASRC_L]);
 					context->vdpmem[context->address] = context->dma_val;
 					context->flags |= FLAG_DMA_PROG;
 				}
@@ -284,6 +283,9 @@
 		if (!(context->flags & FLAG_DMA_PROG)) {
 			context->address += context->regs[REG_AUTOINC];
 			context->regs[REG_DMASRC_L] += 1;
+			if (!context->regs[REG_DMASRC_L]) {
+				context->regs[REG_DMASRC_M] += 1;
+			}
 			dma_len = ((context->regs[REG_DMALEN_H] << 8) | context->regs[REG_DMALEN_L]) - 1;
 			context->regs[REG_DMALEN_H] = dma_len >> 8;
 			context->regs[REG_DMALEN_L] = dma_len;