aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Lange2009-06-15 17:03:49 +0000
committerNorbert Lange2009-06-15 17:03:49 +0000
commit6720928cb6933c1f75573fe401741016a807e894 (patch)
treeaad15ab104eef56e990441a0081a151c1a7b1d85
parentf0b74418bca5c35b7242b7e6b0480c2962364283 (diff)
downloadscummvm-rg350-6720928cb6933c1f75573fe401741016a807e894.tar.gz
scummvm-rg350-6720928cb6933c1f75573fe401741016a807e894.tar.bz2
scummvm-rg350-6720928cb6933c1f75573fe401741016a807e894.zip
Fixed a bug which caused MI Song 3 to loop forever. Made my hack to automatically stop the player after all Patterns are stopped dependend on a variable.
svn-id: r41549
-rw-r--r--sound/mods/tfmx.cpp6
-rw-r--r--sound/mods/tfmx.h2
-rw-r--r--tfmx/tfmxdebug.cpp2
3 files changed, 6 insertions, 4 deletions
diff --git a/sound/mods/tfmx.cpp b/sound/mods/tfmx.cpp
index edd92888e4..a5a0dde624 100644
--- a/sound/mods/tfmx.cpp
+++ b/sound/mods/tfmx.cpp
@@ -49,6 +49,7 @@ Tfmx::Tfmx(int rate, bool stereo)
: Paula(stereo, rate), _resource() {
_playerCtx.enabled = false;
_playerCtx.song = -1;
+ _playerCtx.stopWithLastPattern = true;
for (int i = 0; i < kNumVoices; ++i)
_channelCtx[i].paulaChannel = (byte)i;
@@ -494,7 +495,7 @@ doTrackstep:
goto doTrackstep;
}
}
- if (!runningPatterns) {
+ if (_playerCtx.stopWithLastPattern && !runningPatterns) {
_playerCtx.enabled = 0;
stopPaula();
}
@@ -638,14 +639,13 @@ bool Tfmx::trackStep() {
// if highest bit is set then keep previous pattern
if (patNum < 0x80) {
- _patternCtx[i].command = (uint8)patNum;
_patternCtx[i].step = 0;
_patternCtx[i].wait = 0;
_patternCtx[i].loopCount = 0xFF;
_patternCtx[i].offset = _patternOffset[patNum];
}
- // second byte expose is always set
+ _patternCtx[i].command = (uint8)patNum;
_patternCtx[i].expose = patCmd & 0xFF;
}
return false;
diff --git a/sound/mods/tfmx.h b/sound/mods/tfmx.h
index b6c4862178..37c71e8b38 100644
--- a/sound/mods/tfmx.h
+++ b/sound/mods/tfmx.h
@@ -203,6 +203,8 @@ public:
int8 fadeSlope; */
int tickCount;
+
+ bool stopWithLastPattern; //!< hack to automatically stop the whole player if no Pattern is running
} _playerCtx;
void initMacroProgramm(ChannelContext &channel) {
diff --git a/tfmx/tfmxdebug.cpp b/tfmx/tfmxdebug.cpp
index 0c411582f8..47567f33b7 100644
--- a/tfmx/tfmxdebug.cpp
+++ b/tfmx/tfmxdebug.cpp
@@ -23,7 +23,7 @@ const char *pattcmds[]={
"Fade[speed /endvolume.b]",
"PPat[patt./track+transp]",
"Lock---------ch./time.b]",
- "----------No entry------",
+ "Cue [number.b/ value.w]",
"Stop-Stop custompattern-",
"NOP!-no operation-------"
};