comparison 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
comparison
equal deleted inserted replaced
134:ab50421b1b7a 135:a81c548cf353
223 //verify it myself, I'll assume it's true 223 //verify it myself, I'll assume it's true
224 if (context->flags & FLAG_DMA_PROG) { 224 if (context->flags & FLAG_DMA_PROG) {
225 context->vdpmem[context->address ^ 1] = context->dma_val >> 8; 225 context->vdpmem[context->address ^ 1] = context->dma_val >> 8;
226 context->flags &= ~FLAG_DMA_PROG; 226 context->flags &= ~FLAG_DMA_PROG;
227 } else { 227 } else {
228 context->dma_val = read_dma_value((context->regs[REG_DMASRC_H] << 16) | (context->regs[REG_DMASRC_M] << 8) | context->regs[REG_DMASRC_L]);
229 context->vdpmem[context->address] = context->dma_val; 228 context->vdpmem[context->address] = context->dma_val;
230 context->flags |= FLAG_DMA_PROG; 229 context->flags |= FLAG_DMA_PROG;
231 } 230 }
232 break; 231 break;
233 case CRAM_WRITE: 232 case CRAM_WRITE:
282 break; 281 break;
283 } 282 }
284 if (!(context->flags & FLAG_DMA_PROG)) { 283 if (!(context->flags & FLAG_DMA_PROG)) {
285 context->address += context->regs[REG_AUTOINC]; 284 context->address += context->regs[REG_AUTOINC];
286 context->regs[REG_DMASRC_L] += 1; 285 context->regs[REG_DMASRC_L] += 1;
286 if (!context->regs[REG_DMASRC_L]) {
287 context->regs[REG_DMASRC_M] += 1;
288 }
287 dma_len = ((context->regs[REG_DMALEN_H] << 8) | context->regs[REG_DMALEN_L]) - 1; 289 dma_len = ((context->regs[REG_DMALEN_H] << 8) | context->regs[REG_DMALEN_L]) - 1;
288 context->regs[REG_DMALEN_H] = dma_len >> 8; 290 context->regs[REG_DMALEN_H] = dma_len >> 8;
289 context->regs[REG_DMALEN_L] = dma_len; 291 context->regs[REG_DMALEN_L] = dma_len;
290 if (!dma_len) { 292 if (!dma_len) {
291 context->flags &= ~FLAG_DMA_RUN; 293 context->flags &= ~FLAG_DMA_RUN;