summaryrefslogtreecommitdiff
path: root/vdp.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-04-17 23:58:21 -0700
committerMichael Pavone <pavone@retrodev.com>2017-04-17 23:58:21 -0700
commitfcf214234273a837e7d446a0c6d22aa2a5bb4784 (patch)
tree845dd84f4baf16d16ffdbbcadea6a7c5e90abc94 /vdp.c
parentb0e95d693f4fa5a318fb1f4605dd3608abe01b0f (diff)
Fix time 68K is locked out of bus when doing a 128KB VRAM mode DMA transfer. Fixes a number of problems in Overdrive 2
Diffstat (limited to 'vdp.c')
-rw-r--r--vdp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/vdp.c b/vdp.c
index ee31b47..2280ad9 100644
--- a/vdp.c
+++ b/vdp.c
@@ -2432,9 +2432,12 @@ void vdp_run_dma_done(vdp_context * context, uint32_t target_cycles)
dmalen = 0x10000;
}
uint32_t min_dma_complete = dmalen * (context->regs[REG_MODE_4] & BIT_H40 ? 16 : 20);
- if ((context->regs[REG_DMASRC_H] & 0xC0) == 0xC0 || (context->cd & 0xF) == VRAM_WRITE) {
+ if (
+ (context->regs[REG_DMASRC_H] & 0xC0) == 0xC0
+ || (((context->cd & 0xF) == VRAM_WRITE) && !(context->regs[REG_MODE_2] & BIT_128K_VRAM))) {
//DMA copies take twice as long to complete since they require a read and a write
//DMA Fills and transfers to VRAM also take twice as long as it requires 2 writes for a single word
+ //unless 128KB mode is enabled
min_dma_complete *= 2;
}
min_dma_complete += context->cycles;