Nuked-OPL3 icon indicating copy to clipboard operation
Nuked-OPL3 copied to clipboard

Generate stream fix

Open datajake1999 opened this issue 3 years ago • 1 comments

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

datajake1999 avatar Aug 21 '21 01:08 datajake1999

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;
        }
    }

Hendricks266 avatar Oct 20 '21 20:10 Hendricks266