[Core/CD] fixed potential edge case with CDC DMA halting

This commit is contained in:
ekeeke 2024-02-19 21:47:32 +01:00
parent 3397941b60
commit 30dfba4966
2 changed files with 8 additions and 8 deletions

View File

@ -1003,9 +1003,9 @@ static void scd_write_byte(unsigned int address, unsigned int data)
/* synchronize CDC DMA with SUB-CPU */
cdc_dma_update(s68k.cycles);
/* halt CDC DMA to 2M Word-RAM */
/* halt CDC DMA to 2M Word-RAM (if still running) */
cdc.halted_dma_w = cdc.dma_w;
cdc.dma_w = 0;
cdc.halted_dma_w = word_ram_2M_dma_w;
}
/* Word-RAM is returned to MAIN-CPU */
@ -1341,9 +1341,9 @@ static void scd_write_word(unsigned int address, unsigned int data)
/* synchronize CDC DMA with SUB-CPU */
cdc_dma_update(s68k.cycles);
/* halt CDC DMA to 2M Word-RAM */
/* halt CDC DMA to 2M Word-RAM (if still running) */
cdc.halted_dma_w = cdc.dma_w;
cdc.dma_w = 0;
cdc.halted_dma_w = word_ram_2M_dma_w;
}
/* Word-RAM is returned to MAIN-CPU */

View File

@ -763,9 +763,9 @@ void ctrl_io_write_byte(unsigned int address, unsigned int data)
/* synchronize CDC DMA with MAIN-CPU */
cdc_dma_update((m68k.cycles * SCYCLES_PER_LINE) / MCYCLES_PER_LINE);
/* halt CDC DMA to PRG-RAM */
/* halt CDC DMA to PRG-RAM (if still running) */
cdc.halted_dma_w = cdc.dma_w;
cdc.dma_w = 0;
cdc.halted_dma_w = prg_ram_dma_w;
}
}
else
@ -1092,9 +1092,9 @@ void ctrl_io_write_word(unsigned int address, unsigned int data)
/* synchronize CDC DMA with MAIN-CPU */
cdc_dma_update((m68k.cycles * SCYCLES_PER_LINE) / MCYCLES_PER_LINE);
/* halt CDC DMA to PRG-RAM */
/* halt CDC DMA to PRG-RAM (if still running) */
cdc.halted_dma_w = cdc.dma_w;
cdc.dma_w = 0;
cdc.halted_dma_w = prg_ram_dma_w;
}
}
else