aboutsummaryrefslogtreecommitdiff
path: root/source/soundux.c
diff options
context:
space:
mode:
authorJoão Silva2017-01-16 22:39:57 +0000
committerJoão Silva2017-01-16 22:39:57 +0000
commitcbbfa871ae3d9db3852d9122a6d8355896c073ed (patch)
tree73e7755d117b8dd9eea499977c632727deb20d00 /source/soundux.c
parent7ed90abe19954aaf1fa56657a08e3cae4c8a67ce (diff)
downloadsnes9x2005-cbbfa871ae3d9db3852d9122a6d8355896c073ed.tar.gz
snes9x2005-cbbfa871ae3d9db3852d9122a6d8355896c073ed.tar.bz2
snes9x2005-cbbfa871ae3d9db3852d9122a6d8355896c073ed.zip
Many cleanups.
Diffstat (limited to 'source/soundux.c')
-rw-r--r--source/soundux.c54
1 files changed, 1 insertions, 53 deletions
diff --git a/source/soundux.c b/source/soundux.c
index 9a6c304..280c9f9 100644
--- a/source/soundux.c
+++ b/source/soundux.c
@@ -15,20 +15,6 @@
if ((v) > 32767) \
(v) = 32767
-#define CLIP16_latch(v,l) \
- if ((v) < -32768) \
-{ (v) = -32768; (l)++; }\
- else \
- if ((v) > 32767) \
-{ (v) = 32767; (l)++; }
-
-#define CLIP24(v) \
- if ((v) < -8388608) \
- (v) = -8388608; \
- else \
- if ((v) > 8388607) \
-(v) = 8388607
-
#define CLIP8(v) \
if ((v) < -128) \
(v) = -128; \
@@ -57,14 +43,10 @@ extern int32_t NoiseFreq [32];
static int32_t noise_gen;
-#undef ABS
-#define ABS(a) ((a) < 0 ? -(a) : (a))
-
#define FIXED_POINT 0x10000UL
#define FIXED_POINT_REMAINDER 0xffffUL
#define FIXED_POINT_SHIFT 16
-#define VOL_DIV8 0x8000
#define VOL_DIV16 0x0080
#define ENVX_SHIFT 24
@@ -114,7 +96,7 @@ void S9xSetEnvRate(Channel* ch, uint32_t rate, int direction, int target)
{
ch->envx_target = target;
- if (rate == ~0UL)
+ if (rate == ~((uint32_t) 0u))
{
ch->direction = 0;
rate = 0;
@@ -338,33 +320,6 @@ int S9xGetEnvelopeHeight(int channel)
return (0);
}
-#if 1
-void S9xSetSoundSample(int channel, uint16_t sample_number)
-{
-}
-#else
-void S9xSetSoundSample(int channel, uint16_t sample_number)
-{
- register Channel* ch = &SoundData.channels[channel];
-
- if (ch->state != SOUND_SILENT &&
- sample_number != ch->sample_number)
- {
- int keep = ch->state;
- ch->state = SOUND_SILENT;
- ch->sample_number = sample_number;
- ch->loop = false;
- ch->needs_decode = true;
- ch->last_block = false;
- ch->previous [0] = ch->previous[1] = 0;
- uint8_t* dir = S9xGetSampleAddress(sample_number);
- ch->block_pointer = READ_WORD(dir);
- ch->sample_pointer = 0;
- ch->state = keep;
- }
-}
-#endif
-
void S9xSetSoundFrequency(int channel, int hertz)
{
if (so.playback_rate)
@@ -969,12 +924,6 @@ stereo_exit:
}
}
-// For backwards compatibility with older port specific code
-void S9xMixSamplesO(uint8_t* buffer, int sample_count, int byte_offset)
-{
- S9xMixSamples(buffer + byte_offset, sample_count);
-}
-
void S9xMixSamples(uint8_t* buffer, int sample_count)
{
int J;
@@ -1306,5 +1255,4 @@ void S9xPlaySample(int channel)
APU.DSP [APU_ADSR2 + (channel << 4)]);
}
-
#endif