Nuked-OPL3
Nuked-OPL3 copied to clipboard
Generate stream fix
If the emulator is running at the native OPL3 sample rate, we don't need to call OPL3_GenerateResampled.
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;
}
}