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

Add OPL3_WriteRegDelayed() to buffer with a custom delay #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sulix
Copy link

@sulix sulix commented Jan 26, 2023

Currently, OPL3_WriteRegBuffered() will delay any write by 2 (non-resampled) samples. It's possible that we might want to delay writes by some other (possibly variable) amount.

OPL3_WriteRegDelayed() accepts an additional 'delay' argument, which contains the number of 49,716Hz samples to delay the write by.

Currently, OPL3_WriteRegBuffered() will delay any write by 2
(non-resampled) samples. It's possible that we might want to delay
writes by some other (possibly variable) amount.

OPL3_WriteRegDelayed() accepts an additional 'delay' argument, which
contains the number of 49,716Hz samples to delay the write by.
sulix added a commit to sulix/omnispeak that referenced this pull request Jan 26, 2023
Currently, we delay a few samples after every register write. This can
be confusing, particularly with Nuked_OPL3, which also delays a couple
of samples when OPL3_WriteRegBuffered() is used. It's also ugly to have
to track all of the extra samples queued here and there.

Make the number of delayed samples configurable with:
sd_oplWriteDelay = <num>

It's still based of the sample rate by default, otherwise put the number
of samples you want, or 0 to disable it entirely.

You can also disable/enable the OPL3_WriteRegBuffered() function with
sd_nukedBufferWrites. By default, it's only enabled when
sd_oplWriteDelay is nonzero.

A PR to make NukedOPL3's buffering configurable exists here:
nukeykt/Nuked-OPL3#27

Note that NukedOPL3's buffering is based in the 49716Hz samples, not the
resampled values, like our sd_oplWriteDelay.
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

Successfully merging this pull request may close these issues.

1 participant