aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorNorbert Lange2009-07-19 00:44:54 +0000
committerNorbert Lange2009-07-19 00:44:54 +0000
commit22ee23cac79a4af24f8f49b89411e50c5325aa47 (patch)
tree1a38322f5b9cfe1fb2ff31119fcb5a60b89294f3 /sound
parentbb5207c13b429b6c6c0342d13d5fe885e902f661 (diff)
downloadscummvm-rg350-22ee23cac79a4af24f8f49b89411e50c5325aa47.tar.gz
scummvm-rg350-22ee23cac79a4af24f8f49b89411e50c5325aa47.tar.bz2
scummvm-rg350-22ee23cac79a4af24f8f49b89411e50c5325aa47.zip
some more tables included, for tempo and volume values
svn-id: r42600
Diffstat (limited to 'sound')
-rw-r--r--sound/mods/maxtrax.cpp13
-rw-r--r--sound/mods/maxtrax.h3
2 files changed, 14 insertions, 2 deletions
diff --git a/sound/mods/maxtrax.cpp b/sound/mods/maxtrax.cpp
index 16631b09b0..5908314536 100644
--- a/sound/mods/maxtrax.cpp
+++ b/sound/mods/maxtrax.cpp
@@ -314,8 +314,7 @@ bool MaxTrax::doSong(int songIndex, int advance) {
_playerCtx.musicLoop = false;
setTempo(_playerCtx.tempoInitial << 4);
- _playerCtx.nextEvent = _scores[songIndex].events;
- _playerCtx.nextEventTime = _playerCtx.nextEvent->startTime;
+ _playerCtx.tempoTime = 0;
_playerCtx.scoreIndex = songIndex;
_playerCtx.ticks = 0;
@@ -324,6 +323,16 @@ bool MaxTrax::doSong(int songIndex, int advance) {
for (int i = 0; i < kNumChannels; ++i)
resetChannel(_channelCtx[i], (i & 1) != 0);
+ const Event *cev = _scores[songIndex].events;
+ // Songs are special markers in the score
+ for (; advance > 0; --advance) {
+ // TODO - check for boundaries
+ for(; cev->command != 0xFF && (cev->command != 0xA0 || (cev->stopTime >> 8) != 0x00); ++cev)
+ ;
+ }
+ _playerCtx.nextEvent = cev;
+ _playerCtx.nextEventTime = cev->startTime;
+
_playerCtx.musicPlaying = true;
Paula::startPaula();
return true;
diff --git a/sound/mods/maxtrax.h b/sound/mods/maxtrax.h
index cbc4a5b59f..9fef3e68f0 100644
--- a/sound/mods/maxtrax.h
+++ b/sound/mods/maxtrax.h
@@ -210,6 +210,9 @@ public:
void killVoice(byte num);
int playNote(byte note, byte patch, uint16 duration, uint16 volume, bool rightSide);
+ void setVolume(const byte volume) {
+ _playerCtx.volume = volume;
+ }
void setTempo(const uint16 tempo) {
_playerCtx.tickUnit = (int32)(((uint32)(tempo & 0xFFF0) << 8) / (uint16)(5 * _playerCtx.vBlankFreq));
}