diff options
author | Nebuleon Fumika | 2013-01-12 00:00:29 -0500 |
---|---|---|
committer | Nebuleon Fumika | 2013-01-12 00:00:29 -0500 |
commit | 8338e199dfbd3b956265dfaf78d2b21b083de895 (patch) | |
tree | cd94640be8312b0bb4ade07f588e7bcea264c107 | |
parent | 575e93abdcf6ca037f72943dca22d04861215e42 (diff) | |
download | snesemu-8338e199dfbd3b956265dfaf78d2b21b083de895.tar.gz snesemu-8338e199dfbd3b956265dfaf78d2b21b083de895.tar.bz2 snesemu-8338e199dfbd3b956265dfaf78d2b21b083de895.zip |
More efficient noise generation taken from blargg's code in Snes9x 1.53.
-rw-r--r-- | source/soundux.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/soundux.cpp b/source/soundux.cpp index 329f3bd..d9a3436 100644 --- a/source/soundux.cpp +++ b/source/soundux.cpp @@ -1135,9 +1135,10 @@ void MixStereo (int sample_count) } else { - for (;VL > 0; VL--) - if ((noise_gen <<= 1) & 0x80000000L) - noise_gen ^= 0x0040001L; + // Snes9x 1.53's SPC_DSP.cpp, by blargg + int feedback = (noise_gen << 13) ^ (noise_gen << 14); + noise_gen = (feedback & 0x4000) ^ (noise_gen >> 1); + VL = 0; ch->sample = (noise_gen << 17) >> 17; ch->interpolate = 0; } |