diff options
author | Norbert Lange | 2009-08-13 16:42:36 +0000 |
---|---|---|
committer | Norbert Lange | 2009-08-13 16:42:36 +0000 |
commit | 29b145310c6263124d3a4930136cb7ecba8eb1d8 (patch) | |
tree | c00b39f2a463067d8952181adc3b5c943502d678 /sound/mods | |
parent | 13757d5354c874977b728d9739ecb9ac069d1932 (diff) | |
download | scummvm-rg350-29b145310c6263124d3a4930136cb7ecba8eb1d8.tar.gz scummvm-rg350-29b145310c6263124d3a4930136cb7ecba8eb1d8.tar.bz2 scummvm-rg350-29b145310c6263124d3a4930136cb7ecba8eb1d8.zip |
(re-)initialise some Variables when sound is stopped
svn-id: r43351
Diffstat (limited to 'sound/mods')
-rw-r--r-- | sound/mods/tfmx.cpp | 14 | ||||
-rw-r--r-- | sound/mods/tfmx.h | 2 |
2 files changed, 12 insertions, 4 deletions
diff --git a/sound/mods/tfmx.cpp b/sound/mods/tfmx.cpp index 419dc34bef..ca6c277736 100644 --- a/sound/mods/tfmx.cpp +++ b/sound/mods/tfmx.cpp @@ -294,7 +294,7 @@ void Tfmx::macroRun(ChannelContext &channel) { continue; case 0x06: // Jump. Parameters: MacroIndex, MacroStep(W) - channel.macroIndex = macroPtr[1] & (kMaxMacroOffsets - 1); + // channel.macroIndex = macroPtr[1] & (kMaxMacroOffsets - 1); channel.macroOffset = _resource->macroOffset[macroPtr[1] & (kMaxMacroOffsets - 1)]; channel.macroStep = READ_BE_UINT16(¯oPtr[2]); channel.macroLoopCount = 0xFF; @@ -693,7 +693,7 @@ void Tfmx::noteCommand(const uint8 note, const uint8 param1, const uint8 param2, channel.prevNote = channel.note; channel.note = note; - channel.macroIndex = param1 & (kMaxMacroOffsets - 1); + // channel.macroIndex = param1 & (kMaxMacroOffsets - 1); channel.macroOffset = _resource->macroOffset[param1 & (kMaxMacroOffsets - 1)]; channel.relVol = param2 >> 4; channel.fineTune = (int8)param3; @@ -760,7 +760,8 @@ void Tfmx::haltMacroProgramm(ChannelContext &channel) { void Tfmx::unlockMacroChannel(ChannelContext &channel) { channel.customMacro = 0; - channel.customMacroPrio = false; + channel.customMacroIndex = 0; + channel.customMacroPrio = 0; channel.sfxLocked = false; channel.sfxLockTime = -1; } @@ -791,6 +792,13 @@ void Tfmx::stopSongImpl(bool stopAudio) { haltMacroProgramm(_channelCtx[i]); _channelCtx[i].note = 0; _channelCtx[i].volume = 0; + _channelCtx[i].macroSfxRun = -1; + _channelCtx[i].vibValue = 0; + + _channelCtx[i].sampleStart = 0; + _channelCtx[i].sampleLen = 2; + _channelCtx[i].refPeriod = 4; + _channelCtx[i].period = 4; Paula::disableChannel(i); } } diff --git a/sound/mods/tfmx.h b/sound/mods/tfmx.h index 707eb5952f..26018d9466 100644 --- a/sound/mods/tfmx.h +++ b/sound/mods/tfmx.h @@ -132,7 +132,7 @@ private: struct ChannelContext { byte paulaChannel; - byte macroIndex; +// byte macroIndex; uint16 macroWait; uint32 macroOffset; uint32 macroReturnOffset; |