diff options
author | Norbert Lange | 2009-06-10 13:45:23 +0000 |
---|---|---|
committer | Norbert Lange | 2009-06-10 13:45:23 +0000 |
commit | 6cf0e1b9bb86d99b414535aed6fc488d318ea2d9 (patch) | |
tree | dcc18bcbdb793e4312fa0cc66431ed2e024d0b1d | |
parent | 46c90e08f24c34a6b017c85d927aab9a5082bdd4 (diff) | |
download | scummvm-rg350-6cf0e1b9bb86d99b414535aed6fc488d318ea2d9.tar.gz scummvm-rg350-6cf0e1b9bb86d99b414535aed6fc488d318ea2d9.tar.bz2 scummvm-rg350-6cf0e1b9bb86d99b414535aed6fc488d318ea2d9.zip |
Fix looping of Tracks
svn-id: r41427
-rw-r--r-- | sound/mods/tfmx.cpp | 15 | ||||
-rw-r--r-- | tfmx/tfmxplayer.cpp | 6 |
2 files changed, 13 insertions, 8 deletions
diff --git a/sound/mods/tfmx.cpp b/sound/mods/tfmx.cpp index 8378398096..432f15451c 100644 --- a/sound/mods/tfmx.cpp +++ b/sound/mods/tfmx.cpp @@ -220,6 +220,11 @@ FORCEINLINE bool Tfmx::macroStep(ChannelContext &channel) { } else { //TODO ? } + channel.volume = 0; + Paula::setChannelVolume(channel.paulaChannel, channel.volume); + + if (macroPtr[2] != 0 || macroPtr[3] != 0) + debug("DMA Off: Parameters not implemented %02X%02X%02X", macroPtr[1], macroPtr[2], macroPtr[3]); return true; case 0x01: // DMA On @@ -337,7 +342,7 @@ FORCEINLINE bool Tfmx::macroStep(ChannelContext &channel) { Paula::setChannelSampleLen(channel.paulaChannel, channel.sampleLen); return true; - case 0x14: // Wait key up. Parameters: wait cycles(W) + case 0x14: // Wait key up. Parameters: wait cycles if (!channel.keyUp || channel.macroLoopCount == 0) { channel.macroLoopCount = 0xFF; return true; @@ -398,12 +403,12 @@ FORCEINLINE bool Tfmx::macroStep(ChannelContext &channel) { warnMacroUnimplemented(macroPtr, 0); return true; - case 0x1C: // Splitkey. Parameters: key/macrostep(W) + case 0x1C: // Branch on Note. Parameters: note/macrostep(W) if (channel.note > macroPtr[1]) channel.macroStep = READ_BE_UINT16(¯oPtr[2]); return true; - case 0x1D: // Splitvolume. Parameters: volume/macrostep + case 0x1D: // Branch on Volume. Parameters: volume/macrostep(W) if (channel.volume > macroPtr[1]) channel.macroStep = READ_BE_UINT16(¯oPtr[2]); return true; @@ -480,7 +485,7 @@ doTrackstep: if (_playerCtx.pendingTrackstep) { // we load the next Trackstep Command and then process all Channels again // TODO Optionally disable looping - if (_trackCtx.startInd == _trackCtx.stopInd) + if (_trackCtx.posInd == _trackCtx.stopInd) _trackCtx.posInd = _trackCtx.startInd; else ++_trackCtx.posInd; @@ -672,7 +677,7 @@ void Tfmx::noteCommand(const uint8 note, const uint8 param1, const uint8 param2, channel.macroIndex = param1 % kMaxMacroOffsets; channel.macroOffset = _macroOffset[param1 % kMaxMacroOffsets]; channel.relVol = (param2 >> 4) & 0xF; - channel.fineTune = (int16)param3; + channel.fineTune = (int8)param3; initMacroProgramm(channel); channel.keyUp = true; diff --git a/tfmx/tfmxplayer.cpp b/tfmx/tfmxplayer.cpp index 1e2b905abb..10040148e5 100644 --- a/tfmx/tfmxplayer.cpp +++ b/tfmx/tfmxplayer.cpp @@ -109,9 +109,9 @@ void tfmxmain(const int argc, const char *const argv[]) { if (i < argc) { param = atoi(argv[i]); debug( "play Macro %02X", param); - dumpMacro(*player, 0x11); + dumpMacro(*player, param); playflag = 1; - player->doMacro(param,0x1B); + player->doMacro(param,param); ++i; } break; @@ -143,7 +143,7 @@ void tfmxmain(const int argc, const char *const argv[]) { while( true) player->readBuffer(buf, ARRAYSIZE(buf)); #endif - int maxsecs = 60; + int maxsecs = 2 * 60; if (playflag == 1) { // get Mixer, assume this never fails Audio::Mixer *mixer = g_system->getMixer(); |