diff options
author | Nebuleon Fumika | 2013-01-23 20:05:23 -0500 |
---|---|---|
committer | Nebuleon Fumika | 2013-01-23 20:05:23 -0500 |
commit | d57eea6b4fd4d5d642cb730f6291dabfb0c6a633 (patch) | |
tree | 21d548a3fdb331d4439ab7989bbda43d574e5edd /source | |
parent | 44164cce8c3fa2f0f34d9c5d8c55d4cc576cbe69 (diff) | |
download | snes9x2005-d57eea6b4fd4d5d642cb730f6291dabfb0c6a633.tar.gz snes9x2005-d57eea6b4fd4d5d642cb730f6291dabfb0c6a633.tar.bz2 snes9x2005-d57eea6b4fd4d5d642cb730f6291dabfb0c6a633.zip |
Slight change to soundux.cpp.
Diffstat (limited to 'source')
-rw-r--r-- | source/soundux.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source/soundux.cpp b/source/soundux.cpp index acddd0a..5e7f865 100644 --- a/source/soundux.cpp +++ b/source/soundux.cpp @@ -416,24 +416,25 @@ void S9xSetFilterCoefficient (int tap, int value) void S9xSetSoundADSR (int channel, int attack_rate, int decay_rate, int sustain_rate, int sustain_level, int release_rate) { - SoundData.channels[channel].attack_rate = attack_rate; - SoundData.channels[channel].decay_rate = decay_rate; - SoundData.channels[channel].sustain_rate = sustain_rate; - SoundData.channels[channel].release_rate = release_rate; - SoundData.channels[channel].sustain_level = sustain_level + 1; + Channel *ch = &SoundData.channels[channel]; + ch->attack_rate = attack_rate; + ch->decay_rate = decay_rate; + ch->sustain_rate = sustain_rate; + ch->release_rate = release_rate; + ch->sustain_level = sustain_level + 1; switch (SoundData.channels[channel].state) { case SOUND_ATTACK: - S9xSetEnvelopeRate (channel, attack_rate, 1, 127); + S9xSetEnvRate (ch, attack_rate, 1, 127); break; case SOUND_DECAY: - S9xSetEnvelopeRate (channel, decay_rate, -1, + S9xSetEnvRate (ch, decay_rate, -1, (MAX_ENVELOPE_HEIGHT * (sustain_level + 1)) >> 3); break; case SOUND_SUSTAIN: - S9xSetEnvelopeRate (channel, sustain_rate, -1, 0); + S9xSetEnvRate (ch, sustain_rate, -1, 0); break; } } |