diff options
-rw-r--r-- | source/soundux.cpp | 10 | ||||
-rw-r--r-- | source/soundux.h | 3 |
2 files changed, 8 insertions, 5 deletions
diff --git a/source/soundux.cpp b/source/soundux.cpp index ae5bbad..329f3bd 100644 --- a/source/soundux.cpp +++ b/source/soundux.cpp @@ -142,6 +142,8 @@ extern int Loop [16]; extern long FilterValues[4][2]; extern int NoiseFreq [32]; +static int noise_gen; + #undef ABS #define ABS(a) ((a) < 0 ? -(a) : (a)) @@ -1134,9 +1136,9 @@ void MixStereo (int sample_count) else { for (;VL > 0; VL--) - if ((so.noise_gen <<= 1) & 0x80000000L) - so.noise_gen ^= 0x0040001L; - ch->sample = (so.noise_gen << 17) >> 17; + if ((noise_gen <<= 1) & 0x80000000L) + noise_gen ^= 0x0040001L; + ch->sample = (noise_gen << 17) >> 17; ch->interpolate = 0; } @@ -1833,7 +1835,7 @@ void S9xResetSound (bool8 full) FilterTaps [6] = 0; FilterTaps [7] = 0; so.mute_sound = TRUE; - so.noise_gen = 1; + noise_gen = 1; so.sound_switch = 255; so.samples_mixed_so_far = 0; so.play_position = 0; diff --git a/source/soundux.h b/source/soundux.h index a1417bd..b67dc2a 100644 --- a/source/soundux.h +++ b/source/soundux.h @@ -122,7 +122,8 @@ typedef struct { int sound_switch; int playback_rate; int buffer_size; - int noise_gen; + // int noise_gen; + // Moved to soundux.cpp's noise_gen; this doesn't need volatility! [Neb] bool8 mute_sound; #ifndef FOREVER_STEREO int stereo; |