Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PCM] smarter DMA protection #20

Open
superctr opened this issue Jan 10, 2021 · 0 comments
Open

[PCM] smarter DMA protection #20

superctr opened this issue Jan 10, 2021 · 0 comments

Comments

@superctr
Copy link
Owner

superctr commented Jan 10, 2021

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant