# HG changeset patch # User Mike Pavone # Date 1357006945 28800 # Node ID b42bcfa09cce54740f1cf072a5759c6bd9588346 # Parent 576f55711d8defcba3c887a4fedfbd496fef641b Fix DMA fills to VRAM diff -r 576f55711d8d -r b42bcfa09cce vdp.c --- a/vdp.c Mon Dec 31 18:12:08 2012 -0800 +++ b/vdp.c Mon Dec 31 18:22:25 2012 -0800 @@ -219,15 +219,8 @@ { case VRAM_WRITE: //Charles MacDonald's VDP doc says that the low byte gets written first - //this doesn't make a lot of sense to me, but until I've had a change to - //verify it myself, I'll assume it's true - if (context->flags & FLAG_DMA_PROG) { - context->vdpmem[context->address ^ 1] = context->dma_val >> 8; - context->flags &= ~FLAG_DMA_PROG; - } else { - context->vdpmem[context->address] = context->dma_val; - context->flags |= FLAG_DMA_PROG; - } + context->vdpmem[context->address] = context->dma_val; + context->dma_val = (context->dma_val << 8) | ((context->dma_val >> 8) & 0xFF); break; case CRAM_WRITE: context->cram[(context->address/2) & (CRAM_SIZE-1)] = context->dma_val;