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

Generate stream fix #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

datajake1999
Copy link

If the emulator is running at the native OPL3 sample rate, we don't need to call OPL3_GenerateResampled.

@Hendricks266
Copy link
Contributor

You should delete the change to the line endings. It's not a "fix".

For the actual change in the PR, you should put the if statement outside of the for loop(s) to avoid a performance bug.

    if (chip->rateratio == 1 << RSM_FRAC)
    {
        for (i = 0; i < numsamples; i++)
        {
            OPL3_Generate(chip, sndptr);
            sndptr += 2;
        }
    }
    else
    {
        for (i = 0; i < numsamples; i++)
        {
            OPL3_GenerateResampled(chip, sndptr);
            sndptr += 2;
        }
    }

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.

2 participants