summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2012-12-31 18:22:25 -0800
committerMike Pavone <pavone@retrodev.com>2012-12-31 18:22:25 -0800
commitf3454d9c212d324cfb78000ab3a468e653c190b2 (patch)
treeb22a44488ff91d37bd26c974baeef49b7d8513dd
parente57c4ee8e3a7609b65247612025a56a8452efd5e (diff)
Fix DMA fills to VRAM
-rw-r--r--vdp.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/vdp.c b/vdp.c
index 3c28852..045192f 100644
--- a/vdp.c
+++ b/vdp.c
@@ -219,15 +219,8 @@ void external_slot(vdp_context * context)
{
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;