MDSDRV icon indicating copy to clipboard operation
MDSDRV copied to clipboard

[PCM] smarter DMA protection

Open superctr opened this issue 3 years ago • 0 comments

Read vcounter after each buffer run, and during the idle loop. If there is less than n samples before vblank, set z_min_buffer to the lowest possible value to ensure we don't enter a new buffer run before or at the vblank.

Based on my calculations, we should stop buffering at 28~35 before vblank. The vblank will last for 32~42 samples (NTSC) or 75~100 (PAL V28) or 61~82 (PAL V30).

The vcounter should not be read during vblank as it requires a 68k bus request (and hence, it will cause the Z80 to be halted by the VDP if DMA is in progress)

superctr avatar Jan 10 '21 02:01 superctr